Workflow rule and Custom function help.
My adventures in Zoho Workflow rules and custom functions continue.
I have two workflow rules each with their own custom function.
WFR - 1
When a potential with Type A and stage is marked closed won create project using Template A
void
Create_Projects_for_Closed_Potentials1
(string ProjName, string PortalName, string Template, string AuthToken, string Description )
params = { "authtoken" : input.AuthToken } ;
res = postUrl(url,params) ;
projectId = res.executeXPath("/response/result/ProjectDetails/ProjectDetail[ project_name = '" + input.Template + "'] /project_id/text()") ;
Info projectId;
params.put("projTitle",input.ProjName);
params.put("projDesc",input.Description);
params.put("templateId",projectId);
Info resp;
WFR - 2
When a potential with Type B and stage is marked closed won create project using Template B
void
Create_Projects_for_Closed_Potentials2
(string ProjName, string PortalName, string Template, string AuthToken, string Description )
params = { "authtoken" : input.AuthToken } ;
res = postUrl(url,params) ;
projectId = res.executeXPath("/response/result/ProjectDetails/ProjectDetail[ project_name = '" + input.Template + "'] /project_id/text()") ;
Info projectId;
params.put("projTitle",input.ProjName);
params.put("projDesc",input.Description);
params.put("templateId",projectId);
resp = postUrl("https://projects.zoho.com/portal/" + input.PortalName + "/api/private/xml/project/addprojwithtemplate",params) ;
Info resp;
The first rule works with no issues, the second one fails to create a project.