Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
NSC | Return an Error When the Value of the Field has an Incorrect Format
Just like how passwords need to have a certain length or contain certain characters and emails need to have a domain, some fields in our account need to have a specific format.
In this example, we have a field that needs to have 7 characters and if this condition is not met, the script will return an error:
/*** @NApiVersion 2.1* @NScriptType UserEventScript*/define(['N/search','N/error'],(error) => {/*** Defines the function definition that is executed before record is submitted.* @param{Object}scriptContext* @param{Record}scriptContext.newRecord - New record* @param{Record}scriptContext.oldRecord - Old record* @param{string}scriptContext.type - Trigger type; use values from the context.UserEventType enum
Refer a Member to the Community | Earn the Answer Accepter Badge | Vote for the contents you'd like to see
Tagged:
0
