How to delete a record in Zoho Creator from a Deluge function in CRM
Hello,
I've got a Deluge function in the Zoho CRM triggered by workflow with this code, trying to delete a record containing a product code.
- creatorApiUpdateUrl = "https://www.zohoapis.eu/creator/v2.1/data/xxxxxxxx/yyyyyyyy/report/All_Courses";
- payload.put("criteria","(Course_Code==\"" + coursecode + "\")");
- info "(Course_Code == '" + coursecode + "')";
- info payload;
- // Delete
- deletePayload = Map();
- deletePayload.put("criteria","(Course_Code==\"" + coursecode + "\")");
- //deletePayload.put("skip_workflow", ["form_workflow"]);
- //deletePayload.put("result", {"message": true, "tasks": true});
- info "-------- DELETE PAYLOAD --------";
- info deletePayload;
- creatorApiDeleteResp = invokeurl
- [
- url : creatorApiUpdateUrl
- type : DELETE
- parameters : deletePayload
- connection : "creatorfunctions"
- ];
- info "-------- DELETE RESPONSE ---------";
- info creatorApiDeleteResp;
The payload looks like this.
- {"criteria":"(Course_Code==\"SKU TEST01\")"}
I keep getting this error...
- {"code":1060,"description":"Invalid request parameter found - criteria"}
I've been closely following the documentation and don't understand why this is giving me an error. How can I solve this?
Thanks
Zoho Desk Resources
-
Desk Community Learning Series
-
-
-
-
-
-
-
-
-
Zoho CRM Plus Resources
Zoho Books Resources
Zoho Subscriptions Resources
Zoho Projects Resources
Zoho Sprints Resources
Zoho Orchestly Resources
Zoho Creator Resources
Zoho WorkDrive Resources
Zoho Campaigns Resources
Zoho CRM Resources
Writer Get Started. Write Away!
Writer is a powerful online word processor, designed for collaborative work.