Deluge code to update related record
Hi there,
I got this code to update a "Deals" record with "accounts record" when it is edited/created
- accDetails = zoho.crm.getRecordById("Accounts",input.accId.toLong());
- PotentialDetails = zoho.crm.getRelatedRecords("Deals", "Accounts",input.accId.toLong());
- // info PotentialDetails;
- PotentialList = list();
- for each potential in PotentialDetails {
- // get the potential record
- PotentialId = zoho.crm.getRecordById("Deals", potential.get("id"));
- PotentialList.add(PotentialId.get("id").toLong());
- // PotentialList.toLong();
- }
- info "Potential ID:" + PotentialList;
- segment = accDetails.get("Segment1");
- info segment;
- updatePotentials = zoho.crm.updateRelatedRecord("Potentials", PotentialList.toString(), "Accounts", accId, {"Segment1": "Digital"});
- info updatePotentials;
But when I run it it throws and error saying the data is invalid.
So I did this test,
- updatePotentials = zoho.crm.updateRelatedRecord("Deals",773870000022817004,"Accounts",773870000022790023);
- info updatePotentials
It still throw an invalid Data.
Got no idea what did i do wrong.
Can someone please help?
Thank you