Reputation: 65
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
Upvotes: 0
Views: 427
Reputation: 76
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.
Upvotes: 0