Shelby Owens
10/15/2025, 12:03 PMCeligo AI
10/15/2025, 12:03 PMAI generated answer (using internal Slack threads):****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ****** The issue you're experiencing is due to the fact that the transaction number (tranid) is not generated until after the record is saved. When your After Submit script runs, the transaction number is still in the "To Be Generated" state. To get the actual Purchase Order number, you can use a User Event script with the After Submit event. In this script, you can load the Purchase Order record and get the transaction number (tranid) which should now be generated. Here is a sample script:
javascript
function afterSubmit(scriptContext) {
if (scriptContext.type !== scriptContext.UserEventType.CREATE)
return;
var newRecord = scriptContext.newRecord;
var poNumber = newRecord.getValue('tranid');
// Load the related Case record and update the field
var caseRecord = record.load({
type: record.Type.CASE,
id: 'YOUR_CASE_RECORD_ID'
});
caseRecord.setValue('customfield', poNumber);
caseRecord.save();
}
Please replace 'YOUR_CASE_RECORD_ID' and 'customfield' with your actual Case record ID and the custom field ID you want to update.
Remember to deploy the script and associate it with the Purchase Order record type.Celigo AI
10/15/2025, 12:03 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.852783203
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.842041075
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.841125488
Celigo AI
10/15/2025, 12:03 PM