I seem incapable of working out subform functions without assistance. I've searched, but can't seem to find anything that works.
I have a subform that gets filled in when a Zoho Sign document is completed but the fields don't match with the original field values held on CRM (I did have it automatically update, but some fields were being filled in with terrible data, so had to put a stop to it). There are 4 fields on the subform:
Field Name
Original Value
New Value
Update
Update is automatically sent to yes, unless the record owner reviews it, sees that it is incorrect and amends to no.
They press a button that runs the following code:
personRec = zoho.crm.getRecordById("People", personid);
subform = ifnull(personRec.get("Zoho_Sign_Comparison"),"");
if(subform == "")
{
returnVar = "No fields to update";
}
else
{
for each ele in subform
{
if( ele.get("Update") = "Yes")
{
mp = Map();
mp.put(ele.get("Field_Name"),ele.get("New_Value"));
update = zoho.crm.updateRecord("People", personid, mp);
returnVar = "Fields updated";
// ele.clear();
}
}
// subform.clear();
}
The code works fine and the fields update. However, I want the subform to be cleared once the fields have been updated. I have tried subform.clear() and ele.clear() in the commented areas above but neither works. What am I doing wrong? How can I clear the subform?
[I am not a developer... I am a sales person that is a bit of a bedroom hack, so please be gentle]