Attempting to write a script to pull data from a record into a new record type using an User Event Script. I continue to get an this error: ReferenceError: {custom record type} is not defined at object.afterSubmit.
This is the portion of the code that is failing. This first line is specifically being called out as not defining the custom record. I have it set to the custom record internal ID name.
// Set the value for the 'Name" field customrecord_sample_record_wo_log.setValue({ fieldid: 'name', Value: 'DEL-001'
customrecord_sample_record_wo_logis the ID of the record type, not an instance of the record. To create an instance of the record type you need to use therecord.create()method.Now you can reference the newly created record as
customRecord:Note that
record.createassumes you have defined theN/recordmodule asrecordat the top of your script: