Hi,
I am trying to automate a Production Refresh when a Production Line is created.
However, when I add the report.run in the OnInsert, I get an error that the transaction type can't be chagned from UpdateLocks to Update.
Is there a way I could call the update report Asynchronously so that it does it after the insert transaction is completed?
*This post is locked for comments
Ok, one step further now.
By setting CalcLines it doesn't error out, but the line at that point is not created yet (since I'm still in the OnInsert trigger).
So the component calculation works only for the first line when I insert a second line, so I always have hte last one that is not calculated.
I guess I'll need another place to use call that code. Is there an afterinsert on the Page?
Yes I want it to calculate components automatiacally when we add a line.
Otherwise, people forget to do it and post an empty production...
Why you want to run the refresh production order on line insert ? are you planning to calculate components/routings ? if you are planning to calculate lines then it will not make any sense to do that during insert of a line. If you want to calculate components then on the report make sure you uncheck the lines to calculate.
I tried adding a "Commit" before my call to the update report, but it didn't help.
Any other ideas?
It works, but I get this error. Not sure why it tries to add it a second time.
"Prod. Order Line already exists"
I tried from the Table Line OnInsert and also from the Page OnInsert, and it does the same error.
Edit: Nevermind this message.
Create a copy of the refresh production order report and change the Transaction Type to UpdateLocks and use that in the Oninsert.
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,151 Super User 2024 Season 2
Martin Dráb 229,963 Most Valuable Professional
nmaenpaa 101,156