Marvin
02/13/2026, 4:59 PMrecord.create.promise lists compatibility with only Client Scripts. However in testing it works in user event scripts afterSubmit . Does anybody have insight into this?raghav
02/15/2026, 3:52 AMMarvin
02/16/2026, 5:37 AMcreate.record.promise / await Promise.all(promises) there is a dramatic speedup in the logs. From averaging 5 seconds to within the same second.battk
02/16/2026, 7:42 AMbattk
02/16/2026, 7:43 AMMarvin
02/16/2026, 7:47 AMbattk
02/16/2026, 7:50 AMbattk
02/16/2026, 7:57 AMPromise.reject(new Error("im an error"))
serverside suitescript will not do so. Nor will it follow the normal process of system level logs for uncaught errors or email notificationsMarvin
02/16/2026, 8:14 AMconst results = await Promise.all(createPromises);
log.debug({
title: "scriptname->afterSubmit->results",
details: `Successfully created ${results.filter((r) => r).length} records out of ${createPromises.length} attempts`
});
This would always report n of n the same regardless of failures?battk
02/16/2026, 8:26 AMbattk
02/16/2026, 8:27 AMMarvin
02/16/2026, 8:53 AMMarvin
02/16/2026, 8:56 AMconst typePromise = record.create
.promise({ type: "customrecord_recordtype" })
.then(function (type_record) {
type_record.setValue({ fieldId: "custrecord_customfield", value: customer_id });
return type_record.save.promise({ ignoreMandatoryFields: true });
})
.catch(function (e) {
log.error({ title: "Error creating Record Type", details: `customer: ${customer_id}, Error: ${e.message}` });
});
createPromises.push(typePromise);battk
02/16/2026, 9:25 AM