https://netsuiteprofessionals.com logo
m

mg2017

04/07/2022, 11:50 AM
Copy code
if (context.type === context.UserEventType.CREATE || context.type === context.UserEventType.COPY)
When I used the Make Copy function on a Sales Order I was expecting to see the content.type as copy, instead, it returned create.
Copy code
log.debug({title: "User Event Type", details: context.type});
Copy is listed under event execution contexts so not sure what is happening here?
m

mattdahse

04/07/2022, 2:03 PM
The “copy” event type is only passed to the execution in the beforeLoad entry point on the new record that you’re about to create. It’s mostly for you to clear out fields that need to be empty but that might be brought over as unwanted baggage from the original record.
m

mg2017

04/07/2022, 2:36 PM
Ah, mine is running in beforeSubmit. And that's exactly what I wanted to do, remove an item from the line as that line needs to be calculated