Custom Function create record not triggering workflow rules

Custom Function create record not triggering workflow rules

Hi,

I have the following custom function code which is working as required:

  1. response = zoho.crm.getRecordById("Potentials",input.potential_id.toLong());
  2. schedule=map();
  3. schedule.put("SMOWNERID",response.get("SMOWNERID"));
  4. schedule.put("Revenue Potential_ID",response.get("POTENTIALID"));
  5. schedule.put("CustomModule1 Name",response.get("Potential Name"));
  6. schedule.put("Contact_ID",response.get("CONTACTID"));
  7. schedule.put("Total Amount",response.get("Amount"));
  8. schedule.put("Date of Payment 1",response.get("Date of Inital Deposit"));
  9. schedule.put("Payment Amount 1",response.get("Initial Deposit Amount"));
  10. schedule.put("Payment Method 1",response.get("Initial Deposit Payment Method "));
  11. 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