Replies: 1 comment
-
|
What about a subscriber to the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm not sure if this is the right place to ask, but I'm bashing my head against the wall for the last few hours...
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:
POST: /salesOrders
{
"sellToCustomerNo": "CustomerA",
"locationCode": "LocationB"
}
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"?
Beta Was this translation helpful? Give feedback.
All reactions