Two (similar) custom functions, 1 working, 1 not working

Two (similar) custom functions, 1 working, 1 not working

Hi all,

I'm struggling with two custom functions.

One is working (in a workflow)
The other one isn't (inside another workflow)

The only difference between the two is the field they should update. I can't seem to figure out what is the problem.

See the codes:

Not working:
  1. rec = zoho.crm.getRecordById("Accounts",accId);
  2. resp = zoho.crm.getRelatedRecords("Contacts","Accounts",accId,1);
  3. for each  ele in resp
  4. {
  5. mp = Map();
  6. mp.put("con_modules",ifnull(rec.get("ac_modules"),""));
  7. updateResp = zoho.crm.updateRecord("Contacts",ele.get("id"),mp);
  8. info updateResp;
  9. }

Working:
  1. rec = zoho.crm.getRecordById("Accounts",accId);
  2. resp = zoho.crm.getRelatedRecords("Contacts","Accounts",accId,1);
  3. for each  ele in resp
  4. {
  5. mp = Map();
  6. mp.put("con_type",ifnull(rec.get("ac_soort"),""));
  7. updateResp = zoho.crm.updateRecord("Contacts",ele.get("id"),mp);
  8. info updateResp;
  9. }

When I disable the working function (and workflow), the other one still doesn't work...so I have no idea what's next. I also changed the API syntax for both fields. So that wasn't the problem either.

I'm out of idea's. Can anyone help?

Many thanks.

KR, Iris