I am trying to convert a lead in zoho crm to a potential from Creator.
I have followed the documentation here as best I can:
I have created the XML String but im not sure I know how to properly post this.
I am using POST URL function and hopefully I have it formatted correct. I took all my values and put them into a map variable including my XML string.
The process of stringing together values to make the XML string is pretty stupid. Maybe there is a better way to do this?
Here is the code i have put together but i am getting an error and im not sure how to diagnose this error.
Error "
4500 Internal server error while processing this request"
- xml_string="<Potentials><row no='1'><option val='createPotential'>true</option><option val='assignTo'>info@precisionsailloft.com</option><option val='notifyLeadOwner'>false</option><option val='notifyNewEntityOwner'>false</option></row>";
- xml_Name="<row no='2'><FL val='Potential Name'>" + lfirst + " " + llast + "</FL>";
- xml_Closing="<FL val='Closing Date'>" + zoho.currentdate + "</FL>";
- xml_Stage="<FL val='Potential Stage'>Closed Won</FL>";
- xml_Role="<FL val='Contact Role'></FL>";
- xml_Amount="<FL val='Amount'>" + net + "</FL>";
- xml_Probability="<FL val='Probability'>100</FL></row></Potentials>";
- lead_num=Client_Info.Lead_ID.toString();
- POTENTIALXMLDATA=xml_string + xml_Name + xml_Closing + xml_Stage + xml_Role + xml_Amount + xml_Probability;
-
- topotential = map();
- topotential.put("authtoken", "apitokenhidden");
- topotential.put("scope", "crmapi");
- topotential.put("leadId", Client_Info.Lead_ID.tostring());
- topotential.put("newFormat", 1);
- topotential.put("version", 2);
- topotential.put("xmlData",POTENTIALXMLDATA);
-
-
- convertlead2 = postUrl("https://crm.zoho.com/crm/private/xml/Leads/convertLead",topotential, false);