Custom Function create record not triggering workflow rules
Hi,
I have the following custom function code which is working as required:
- response
= zoho.crm.getRecordById("Potentials",input.potential_id.toLong());
- schedule=map();
- schedule.put("SMOWNERID",response.get("SMOWNERID"));
- schedule.put("Revenue Potential_ID",response.get("POTENTIALID"));
- schedule.put("CustomModule1
Name",response.get("Potential Name"));
- schedule.put("Contact_ID",response.get("CONTACTID"));
- schedule.put("Total Amount",response.get("Amount"));
- schedule.put("Date
of Payment 1",response.get("Date of Inital Deposit"));
- schedule.put("Payment
Amount 1",response.get("Initial Deposit Amount"));
- schedule.put("Payment
Method 1",response.get("Initial Deposit Payment Method "));
- insert_response
= zoho.crm.create("CustomModule1",schedule);
I have a workflow rule that is supposed to trigger when
CustomModule1 field "Date of Payment 1" is not empty. This
works correctly when creating a CustomModule1 record manually but not
when it the record is created by the custom function code above. The
record is created and the workflow criteria is met but it is not
triggered. Is there any way I can trigger workflow rules when using
the zoho.crm.create method in a custom function?
Thanks,
Michael