How to update the lookup field of a record using Zoho CRM Client Script.
I have two modules:
- Payments_Received
- In this module there is a lookup field to Instalments
- Instalments
- In this module there is a lookup field to Payments_Received
What I am trying to do:
- I want to setup a client script on the edit page, trigger is onSave, where when the editing the Instalment and selecting a Payments_Received record in lookup field, I also want to update the Payments_Received record's Instalment lookup field with this Instalment.\
- But I dont know what to use as the assignment when using the updateById function?
Example:
- var payments_received = ZDK.Apps.CRM.Leads.fetchById(payments_receivedID);
- payments_received.Instalments_Association = ??????; // <<--- This is a lookupfield of the payments_received record, I want to update this field so i can update with the a link back to Instalment
- var response = ZDK.Apps.CRM.Leads.upadteById(payments_received, instalmentId);