0

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

antechf11
  • 55
  • 4

1 Answers1

0

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.

  • sorry i'm still learning about javascript and suitescript. Can show me an full script about this condition. Because i got probelm : --org.mozilla.javascript.EcmaError: TypeError: Cannot find function submitField in object Thu Dec 08 2022 00:00:00 GMT-0800 (PST)-- – antechf11 Dec 09 '22 at 04:05
  • There you have an example: https://stackoverflow.com/questions/74739827/suitescript-userevent-submitfield – Camilo Castellano Dec 12 '22 at 00:27