Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

How can I update the Vendor ID with new number seq by sql via code?

(0) ShareShare
ReportReport
Posted on by 162

I want to update the vendor id across all the legal entities according to the custom number sequence defined. Can any one please share how one can fetch the number sequence of vendor ID via code?

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: How can I update the Vendor ID with new number seq by sql via code?

    Please check if number sequence for vendor account is setup in Account payable parameters.

    pastedimage1682639578604v1.png

    Check the number sequence is setup properly, please try this code and debug where its failing. Also, please check if number sequence is working correctly when vendor is created manually from All vendors form.

    _sequence = NumberSeq::newGetNum( VendParameters::numRefVendAccount());

  • Harshal Jain Profile Picture
    Harshal Jain 162 on at
    RE: How can I update the Vendor ID with new number seq by sql via code?

     sequence = NumberSeq::newGetNum( NumberSeqReference::findReference(extendedTypeNum(VendAccount)));
     info(sequence.num());

    Hi Mohit,

    I have used the following code to generate the number sequence, but its returning blank. Any suggestions?

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: How can I update the Vendor ID with new number seq by sql via code?

    Hi Harshal, Please check below article. There is a method numRefVendAccount in VendParameters table.

    community.dynamics.com/.../how-to-find-next-value-from-sequence-number-when-sequence-number-reference-not-in-parameter-table

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,996 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,853 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans