web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

how linenum gets assigned in the purchase line???

(0) ShareShare
ReportReport
Posted on by 439

Hi all,

I am developing a form which is similar to the purchase order and  where as I have a header table and line table.

In line table I have added the a field linenum and I wanted to know how the linenumber gets assigned every time we create a new record in the purchase line so that I can implement that thing in my form too,

Please through some lights on that.

SO far I have added  a field and added the same EDT which is given over there in the purchase line but not sure how the purchase line number gets assigned every time we create a new line.

Thanks you

I have the same question (0)
  • Suggested answer
    vinitgoyal2005 Profile Picture
    6,332 on at

    Hi,

    check method lastLineNum in purchLine table.

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Rohit,

    You can take a look at Classes\TradeLineNumberManager\doUpdateLineNumber method as well. This method uses the lastLineNumber method Vinit mentioned and adds the increment from System parameters.

  • rohit1900 Profile Picture
    439 on at

    I tried to put the debugger there but it is not hitting...

    I did the find reference for the method

    /Classes/SuppItemCreate_Purch/Methods/createLine - (27, 24)

    /Tables/PurchLine/Methods/lastLineNum - (12288, 28)

    it is called one place in the SuppItemCreate_Purch that too at line no 27 and it is just comparison

           lineNumberManager.setLine(purchLine);

           if (PurchLine::lastLineNum(purchLine.PurchId) == basePurchLine.LineNumber)

           {

               lineNumberManager.preUpdateLineNumber(true);

           }

           els

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Rohit,

    Do you have this checkbox unmarked? 

    Go to VS > Dynamics 365 > Options

    pastedimage1600721915845v1.png

    This will let you debug the method

  • rohit1900 Profile Picture
    439 on at

    4338.test.png

  • rohit1900 Profile Picture
    439 on at

    yes it is same... as you mentioned

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Can you try placing a breakpoint on Purchline\insert and try?

  • rohit1900 Profile Picture
    439 on at

    I think it i going inside the method

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    You can step into this method -

    TradeLineNumberManager::updateLineNumberOfNewOrder(this);

  • rohit1900 Profile Picture
    439 on at

    Hi what is the class for the sales line? like how TradeLineNumberManager is for the purchline

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 467 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 420 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 241 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans