Hi, I can't seem to work out how to get the new project ID created when we create a project from the CRM.
I have created a function that creates a new project based on varying templates we have created in projects. It all works fine and has done for quite some time, however now I want to get the ID of the new project and copy that into a field in the Invoice in our CRM. At a later date I want to update some custom fields in the project when they are completed in the CRM but of course I need a project ID to do that.
FOR CLARITY: The projectID I refer to in my code below is the template that we use NOT the project ID from zoho. Bad naming convention I know but at the time it was our projectID that we were adding to the template name and it wasn't as important).
This is my code to add the project based on our CRM info. Can someone help me to adjust this so I can get the ID (Zoho's ID) of the project created. IE Does the zoho project ID come back with the resp and if so how do I get it out of that.
url = "
https://projects.zoho.com/portal/" + PortalName + "/api/private/xml/project/getprojtemplates";
params = Map:String({"authtoken":AuthToken});
res = postUrl(url,params);
projectId = res.executeXPath("/response/result/ProjectDetails/ProjectDetail[ project_name = '" + Template + "'] /project_id/text()");
info projectId;
params.put("projTitle",ProjName);
params.put("projDesc",Description);
params.put("templateId",projectId);
resp = postUrl("
https://projects.zoho.com/portal/" + PortalName + "/api/private/xml/project/addprojwithtemplate",params);