HELP NEEDED
Added SubOrderNo code 20 to Sales Header table.
Added OrderRefNo text 30, SubOrderNo code 20 to Sales Line table.
When Sales Order form is opened, Sales Order Line will setrange based on Sales Header SubOrderNo.
By default, Sales Line SubOrderNo will be the same as Sales Header SubOrderNo.
eg. Sales Header: Document No. = 10010
SubOrderNo = 1
Sales Line: (1st line) OrderRefNo = ER1 Order (manually key)
SubOrderNo = 1
Item = 133
(2nd line) OrderRefNo = ER1 Order (should be auto)
SubOrderNo = 1
Item = 135
Each time i create a new line, I want the system to automatically copy the OrderRefNo from the previous line. Only applicable to 2nd line onwards.
I can't assign another variable(eg. storeOrderRef) to OrderRefNo. It will only work for this SubOrderNo. Cause if I create another SubOrderNo (i.e. 2) for Document No. 10010, and if I go back to the previous SubOrderNo (i.e. 1), I cannot use variable storeOrderRef cause the OrderRefNo will now be different(cause it will reflect that of SubOrderNo 2).
I hope my explanation is clear enough and you understand what I'm trying to say.
Thanks.
0
Answers
2) If your new field is not part of the primary key of the Lines (it means that you extended the PK of the table), you will have problems with the AutoSplitKey functionality when entering the lines into the order if you will filter the lines in this way... I recommend to thing about that...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Try to put some code, to the "No." validate trigger of the sales line. SalesLine is a local variable of type Record from table 37.
If this is not helping You, try to write the problem more clearly.
I will try to help You then.
GoodLuck
thanks so much for your help.
But to kine, unfortunately, I can't use the PopulateAllFields as my data defers.
As for krzychub83, tanx for ur code. I did tried that before i post here but it didn't entirely work. :-s tanx though.
In my main Sales Order, I can have multiple suborders.
I managed to solved it though. I created a table to store the unique suborder number. From there, if user select a particular number, the details will follow accordingly. dat seems to be d best way out. on top of that, i remove the autosplitkey function n automaticaly assign my own line no.
Thanks once again all.