I am building a simple API page for Sales Header and need to be able to override the Location Code to the one provided in the request (if provided). So if I send the request like:
I want the Location Code on the Sales Order to be set to LocationB. Unfortunately, on the "Sales Header" table, there is a OnInsert trigger that defaults the "Location Code" (in the InitRecord() procedure)... I don't seem to be able to override this in page OnInsertRecord trigger (it's called before the table OnInsert I guess?) - so I'm stuck. I can make another request (PATCH), then it works fine, but I'd like to avoid that as much as possible.
I thought about using IntegrationEvent OnBeforeUpdateLocationCode, but I don't want to modify the standard BC behavior outside of this single API page.
Is there an answer to this? Other than "make a buffer table and insert into it, instead of directly into the Sales Header"?
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.