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
Hi Rohit,
Were you able to resolve this issue as well? In case you did, please mark the correct answer(s) as verified.
Hi,
You will find most tables which have a LineNumber column contains method LastLineNum, you will have a similar implementation in all tables.
You need to do the exactly same for your your custom table.
Hi Rohit,
The simplest way is overriding the insert method on your line table and initialize the line number before super.
Check the example in PurchRFQCaseLine.Insert and line
this.LineNum = PurchRFQCaseLine::lastLineNum(this.rfqCaseId) 1.0;
Rohit,
You can check Data entities\SalesOrderLineV2Entity\insertEntityDataSource() method as well. This code sets the line number -
salesLine.LineNum = salesLine.LineNum ? salesLine.LineNum : SalesLine::lastLineNum(this.SalesOrderNumber) 1;
I am not sure. I think it is using the same class as it has the same structure.
You can debug to be sure.
Hi what is the class for the sales line? like how TradeLineNumberManager is for the purchline
You can step into this method -
TradeLineNumberManager::updateLineNumberOfNewOrder(this);
I think it i going inside the method
Can you try placing a breakpoint on Purchline\insert and try?
yes it is same... as you mentioned
Martin Dráb
510
Most Valuable Professional
Saalim Ansari
315
Adis
312
Super User 2025 Season 1