<@U03QT1MRPHP> I am working on something like this...
# suitescript
k
@Surapaneni 377 I am working on something like this right now. I have not been able to get it to work but here is a starting point
Copy code
const beforeSubmit = (scriptContext) => {

    var newRecord = scriptContext.newRecord
    var oldRecord =scriptContext.oldRecord


    var standardRoyalty = newRecord.getValue({
        fieldId: 'custrecord_lf_school_std_roy_perc'
    });
    var headwearRoyalty = newRecord.getValue({
        fieldId: 'custrecord_lf_school_hdwr_roy_perc'
    })

    const schoolName = newRecord.getValue({
        fieldId: 'custrecord_lf_school_name'
    });

var id = record.submitFields({
            type: record.Type.CUSTOMER,
            id: customerId,
            values: {
                'custentity_lf_hdwr_roy_new': headwearRoyalty,
                'custentity_lf_std_roy_rate_new': standardRoyalty
            }






}
e
where is
customerId
defined? what record is this executing on?
d
btw, here's how to create a new snippet for posting longer scripts *as a bonus, it does syntax highlighting