I have been asked to automate the process to create a product order in the Sales Order form. It is usually done using the ORDER menu button -> Planning, then FUNCTIONS menu button -> Create prod. order. I have added a boolean field in the details (Sales Line) and check it in the OnValidate trigger of the table, then run the same code they do. However, the Sales Line record hasn't been saved yet, so it doesn't fill the next form with the data. In the Sales Order form, the record is added either on a new line or when a menu or command button is clicked. Is it possible to trigger the add myself (an Insert was not allowed)? It seems to happen behind the scenes. Not surprisingly, there seem to be a few issues arise when you change the type of object the code is being called from.
Just knowing if this is possible, or a suggestion for a different approach would be great.
Thanks!
SGM
0
Comments
I would first follow a different approach. First i would create a boolean field on the sales line and at the time of posting in Codeunit 80 i would create a function which would check for the sales line where the boolean field is checked off and for those lines i would replicate the same create. prod. order function. This way you are not locking any table and is a clean way of doing this task.
Thanks
Best regards
Suresh.
NJ
Thanks
Have you tried adding the code to the "Sales Line" Form. You could add the code to The OnAfterValidate Trigger of Field "No.". For an example look at the OnAfterValidate trigger for field "Quantity" on the "sales Line" form this is used for Reservations.
Its for Navision Financials but iam sure should work for u too.
I didn't read all, just did a fly throu but sounds like they have a conclusion to simulate a Buttonclick from Code.
http://www.mibuso.com/forum/viewtopic.php?t=598&highlight=click
RIS Plus, LLC