Automatically Create A Project in Zoho Projects From Zoho CRM Potential

Automatically Create A Project in Zoho Projects From Zoho CRM Potential

I want to accomplish the following using a Zoho CRM workflow rule custom function:
  1. Automatically create a project in Zoho Project from inside Zoho CRM
  2. Set the project start and end dates
  3. Set tasks start date and due dates
  4. Associate the Zoho Project with the appropriate Zoho CRM Potential
I have been able to successfully accomplish item #1 but I'm having issues with the other items.

My request is for assistance with the code to accomplish items 2, 3 & 4. Since I am new to this, I would appreciate working code examples if possible.

Here's what I've done.
  • Created a project template in Zoho Project
  • Integrated Zoho Project & CRM with your marketplace app
  • Setup a CRM workflow rule to trigger on a field update
  • Workflow triggers a custom function which is below:
  1. url="https://projects.zoho.com/portal/" + input.PortalName + "/api/private/xml/project/getprojtemplates";
  2. params={ "authtoken" : input.AuthToken };
  3. res = postUrl(url,params);
  4. projectId = res.executeXPath("/response/result/ProjectDetails/ProjectDetail[ project_name  = '" + input.Template + "'] /project_id/text()");
  5. info projectId;
  6. params.put("projTitle",input.ProjName);
  7. params.put("projDesc",input.Description);
  8. params.put("templateId",projectId);
  9. resp = postUrl("https://projects.zoho.com/portal/" + input.PortalName + "/api/private/xml/project/addprojwithtemplate",params);

The function works and creates a Zoho Project with a name and description. The issues I'm having is that I cannot set the project start and end dates

What I've tried so far:
  • I created two new Arguments
    • StartDate
    • EndDate
  • I tried adding to the original working code various versions of the new param values below
  1. params.put("projstartdate",input.StartDate);
  2. params.put("projenddate",input.EndDate);

They did not work. 

Regarding setting tasks start and due dates, we are an event based company and our project tasks due dates are based off the project end date. For example, send out an email reminder 7 days before the event date (project end date).

Since I have been unable to set the project start and end dates, I have not been able to move forward on this. I have read your documentation and forum posts but would appreciate code examples for this too.

Last is associating the newly created project with the appropriate Zoho CRM potential by having it listed under the Zoho Projects section that is created by your Zoho Projects & CRM marketplace sync app. 

I have no idea about how to do this and cannot find any documentation or forum posts related to doing this. Would appreciate your help on this as well.