source po number from a vendor to a custom field o...
# ask-stanley-ai
m
source po number from a vendor to a custom field on a custom record
c
AI generated answer (using internal Slack threads):
To source the PO number from a vendor to a custom field on a custom record, you can use a workflow or a script. If you want to use a workflow, you can create a workflow on the Purchase Order record with a Set Field Value action. The trigger for this workflow could be 'After Record Submit' or 'Before Record Load' depending on your specific use case. The Set Field Value action would then set the value of your custom field to the value of the PO number field. If you want to use a script, you can use a User Event script that triggers on the 'After Submit' event of the Purchase Order record. In this script, you would get the value of the PO number field and then set the value of your custom field to this value. Here is a sample SuiteScript code snippet that demonstrates this:
Copy code
javascript
function afterSubmit(scriptContext) {
    var newRecord = scriptContext.newRecord;
    var poNumber = newRecord.getValue('tranid'); // Assuming 'tranid' is the field id of the PO number field

    var customRecord = record.create({
        type: 'customrecord_your_custom_record_type' // Replace with your custom record type id
    });
    customRecord.setValue('custrecord_your_custom_field', poNumber); // Replace 'custrecord_your_custom_field' with your custom field id
    customRecord.save();
}
Please replace 'customrecord_your_custom_record_type' and 'custrecord_your_custom_field' with your actual custom record type id and custom field id respectively. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.83984381
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.836120665
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.831543
Please provide your feedback on this answer.