Greetings to all of you!
I will try to explain my question with an example:
Lets say that i want to insert a new line , through AL , in the sales line table.
If i had to do it through the interface like a normal user does, when i fill the quantity with the value 1 , the system will automatically fill the values of the relevant quantity fields.
My problem is that , if i input the line myself through code, and set the quantity of the item line to be equal to 1, the system wll not automatically fill the values of the relevant fields such as outstanding qty, qty to ship,qty to invoice e.t.c.
Due to that , i need to go myself and do it manually which is a little bit annoying.
I bet that there is a smarter way to do it that i just dont know about.
Any thoughts?
Thank you in advance lads!
Thank you both!!
Hi, I think you should fill the values using "Validate" method. For example, you can use it like InsertSalesLines.Validate(Quantity, 1); it will execute the onValidate() trigger of that particular field. and will automatically fill in all the relevant fields that depend on the quantity, just as you mentioned you do on the user interface.
I hope this helps you.
Regards
Hi,
Please use only like this
Insersaleslines.validate(Quantity,1);
Insersaleslines.insert(true);
rest leave on the system
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156