Sales Line

In Sales Order “Line No.” get incremented before OnInsert(). How does it happen? Which codeunit, which function is been used to do so. Form which trigger or function does it called? The reff table is Sales Line(ID-37) The reff Forms are (42,46) Please mail me ‘biswassoumyadip@yahoo.com’ Thank You

Hello, Design one of the subforms that the Sales Line table (Like Form 46 ‘Sales Order Subform’). Go to the form properties - One of them is called AutoSplitKey and you will find that for forms where there is a Line No. field that is auto incremented, this is set to ‘Yes’.

Look for the Form’s AutoSplitKey property and read about it in the online Help system.

Thanx I will try it.

I have tried it & its working. But it is incrementing in ten thousands for decimal & in hundreds for integer.Is there any way to set it manualy. means if i want to increment 5000 for decimal & 1000 for integers. Thank You

Hi Soumyadip, Autosplit Key property in the subform is incrementing the line No. by 10,000 by defualt and this you can not change through property, but you can write code on the OnInsert of the sales line table to increment the line no. by 5000. Autosplit ket works in conjection with the Primary key of the table. Line No. is the last field in the primary key in the sales line table, and AutospiltKey is true, that’s why program is incrementing the line no. by 10,000 on the sales line subform. you can turn off the Autosplitkey and If you want to increament the line by 5000 on this Sales Order Subform only than write the code on the subform’s “Form - OnInsertRecord()”, otherwise write this code on the OnInsert of the sales line table: Create a local variable as SalesLine2 and write the following code on the form’s trigger “Form - OnInsertRecord()” SalesLine2.SETRANGE(“Document Type”,“Document Type”); SalesLine2.SETRANGE(“Document No.”,“Document No.”); IF SalesLine2.FIND(’+’) THEN “Line No.” := SalesLine2.“Line No.” + 5000 ELSE “Line No.” := 5000; Hope this will help. Naveen Jain

Thank You IT Was Realy VEry Helpful

Closed and moved to Navision Development Forum.