I have a transaction record. if i change the locat...
# suitescript
v
I have a transaction record. if i change the location field in the transaction record, the address field of the corresponding customer should change by reloading the page. i want to take the url of the customer record now to reload it. how can this be achieved? I deployed the script on transaction record.
r
In userevent Check old record context location and new record context location. If they do not match, Get the customer internal id from the transaction record. Either load the customer record > update the location > save the record Or use submitfield API to update the location in customer record. Ideally the location of the customer should be updated and the same should flow for any new transaction in the system.
v
no its client script fieldchanged function
r
As long as all transaction are created through UI client script is ok, but I still recommend userevent for this. Also initially that location field will be blank while creating new transactions. So once you update the location it will trigger the field change, you might want to handle it. Also let's say the user changes the location on the transaction record 10 times before saving it, you will be updating the customer record 10 times? Either a userevent or client script save record where you get the location of transaction Gets the customer internal id, checks it's location and see whether it's matching or not, If not update the record.
v
ok, now i need the url for this to update and save the customer record. i believe url module can only be used for the deployed record.
r
Why do you need the url am not getting ? You mean internal id?