RE: UserEvent Script on Quote creation not executed?

Could there be cases where a user event script not being executed?

When my script is called on a quote creation (afterSubmit) I print logs with the quote id, the goal of this script is to resolve contacts from the customer and attach them to the quote.

This seems to work pretty well, but once in a while, it looks like it didn’t run.

For debugging purpose, I’ve downloaded all the past logs from the script in a csv file from the Script Execution Log page.

When searching into it, I can’t find my log, which I find weird, because it’s first thing I do when it’s called, heres the script entry point:

export let afterSubmit: EntryPoints.UserEvent.afterSubmit = (context: EntryPoints.UserEvent.afterSubmitContext) => {
  if (context.type !== context.UserEventType.CREATE) {
    return;
  }

  const customerDealerId = context.newRecord.getValue('entity') as string;
  log.debug(`Quote created customer / dealer is ${customerDealerId}`, context.newRecord.toString());

  const contacts = loadCustomerContacts(customerDealerId);
  attachContactsToQuote(context.newRecord, contacts);
};
pascallalonde Rookie Asked on August 1, 2022 in SuiteScript.
Add Comment
1 Answers

Ok, so it seems I was misled by the users reporting the ticket, in theory, what I did still works “as expected”.

Rookie Answered on August 1, 2022.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.