The vendor field "Print on Check As" always defaul...
# ask-stanley-ai
g
The vendor field "Print on Check As" always defaults to "Copied From Name" instead of either being blank or producing the actual name updated on the Vendor Record. How do I stop it from entering "Copied From Name"
c
AI generated answer (using internal Slack threads):
The "Print on Check As" field in the Vendor record defaults to the Vendor Name when the record is created. If you want to stop it from entering "Copied From Name", you can create a workflow or a script that will clear this field or update it with the actual name from the Vendor record whenever a Vendor record is created or updated. Here is a sample SuiteScript 2.0 code that you can use as a starting point. This script will be triggered whenever a Vendor record is created or edited, and it will set the "Print on Check As" field to the same value as the Vendor Name.
Copy code
javascript
/**
 * @NApiVersion 2.x
 * @NScriptType UserEventScript
 */
define(['N/record'], function(record) {
    function beforeSubmit(context) {
        if (context.type === context.UserEventType.CREATE || context.type === context.UserEventType.EDIT) {
            var vendor = context.newRecord;
            var vendorName = vendor.getValue('companyname');
            vendor.setValue('printoncheckas', vendorName);
        }
    }

    return {
        beforeSubmit: beforeSubmit
    };
});
Please note that you need to deploy this script to the Vendor record type and make sure that it has the necessary permissions to update Vendor records. ****** 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.848231852
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.831750631
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.830716848
Please provide your feedback on this answer.