Hello Guys, Can we override the automatically gene...
# suitescript
a
Hello Guys, Can we override the automatically generated "Transaction Number" field on Customer Refund?
w
I've had to do this recently with an after submit user event. It looks like that number it gets assigned based on the check number field, but I cannot find a way to turn that off.
Doing lookups and submits seems to run a little faster than a whole record load & save. This should just put the "CUSTRFND44" in that field.
Copy code
let documentLookup = search.lookupFields({
    type    : search.Type.CUSTOMER_REFUND,
    id      : recordID,
    columns : ['transactionnumber']
});
let values = {};
values.tranid = documentLookup.transactionnumber;
record.submitFields({
    type   : record.Type.CUSTOMER_REFUND,
    id     : recordID,
    values : values
});
a
@Webber I am using below code while creating the Customer Refund, customerRefund.setValue({ fieldId: 'transactionnumber', value: refundId }); But unable to set it.
w
you cannot directly edit the record object passed in the parameters of a user event; you must load the record independently. Also in my example I am setting the
tranid
field not the
transactionnumber