Netsuite Suitescript Client Script

304 Views Asked by At

I'm still learning on suitescript. can we change (fieldChanged) that comes from another record?

for example we edit the date field in 'fullfilment'. then the fullfilmet item field on the sales order will change according to the date on the fullfilment

can show me an example script Thank you for your help

1

There are 1 best solutions below

2
Camilo Castellano On

Yes, you can do it with:

record.submitFields({
                    type: record.Type.SALES_ORDER,
                    id: currentRecord.getValue('createdfrom'),
                    values: {
                        trandate: currentRecord.getValue('trandate')
                    },
                    options: {
                        enableSourcing: false,
                        ignoreMandatoryFields : true
                    }
                });

But I don't recommend to do it on a Client Script because on the fieldchange event the record was not submit yet and is not guaranteed that is going to be. I recommend to do it on a User Event Script.