Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Qualify Lead to Opportunity, wrong currency

$
0
0

Hi,

I'm using a custom function to qualify a Lead to an Opportunity. The request I'm using is below, I'm creating only an Opportunity.

All fields match but Currency is always Euro even the currency of the Lead is Sterling Pound.

I read this can be due to default currency in the system, but this is something wasn't happening in CRM 2011. Is there anyway I can edit SOAP request to add current currency?

I tried to add these lines to the request without luck.

request.push("<a:KeyValuePairOfstringanyType>");
request.push("<c:key>transactioncurrencyid</c:key>");
request.push("<c:value i:type=\"a:Lookup\">");
request.push("<a:Value>"Xrm.Page.getAttribute("transactioncurrencyid")"</a:Value>");
request.push("</c:value>");
request.push("</a:KeyValuePairOfstringanyType>");

varrequest=[];
request.push("<s:Envelopexmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">");
request.push("<s:Body>");
request.push("<Executexmlns=\"http://schemas.microsoft.com/xrm/2011/Contracts/Services\"xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\">");
request.push("<requesti:type=\"b:QualifyLeadRequest\"xmlns:a=\"http://schemas.microsoft.com/xrm/2011/Contracts\"xmlns:b=\"http://schemas.microsoft.com/crm/2011/Contracts\">");
request.push("<a:Parametersxmlns:c=\"http://schemas.datacontract.org/2004/07/System.Collections.Generic\">");
request.push("<a:KeyValuePairOfstringanyType>");
request.push("<c:key>LeadId</c:key>");
request.push("<c:valuei:type=\"a:EntityReference\">");
request.push("<a:Id>"+Xrm.Page.data.entity.getId()+"</a:Id>");
request.push("<a:LogicalName>lead</a:LogicalName>");
request.push("<a:Namei:nil=\"true\"/>");
request.push("</c:value>");
request.push("</a:KeyValuePairOfstringanyType>");
request.push("<a:KeyValuePairOfstringanyType>");
request.push("<c:key>CreateAccount</c:key>");
request.push("<c:valuei:type=\"d:boolean\"xmlns:d=\"http://www.w3.org/2001/XMLSchema\">false</c:value>");
request.push("</a:KeyValuePairOfstringanyType>");
request.push("<a:KeyValuePairOfstringanyType>");
request.push("<c:key>CreateContact</c:key>");
request.push("<c:valuei:type=\"d:boolean\"xmlns:d=\"http://www.w3.org/2001/XMLSchema\">false</c:value>");
request.push("</a:KeyValuePairOfstringanyType>");
request.push("<a:KeyValuePairOfstringanyType>");
request.push("<c:key>CreateOpportunity</c:key>");
request.push("<c:valuei:type=\"d:boolean\"xmlns:d=\"http://www.w3.org/2001/XMLSchema\">true</c:value>");
request.push("</a:KeyValuePairOfstringanyType>");
request.push("<a:KeyValuePairOfstringanyType>");
request.push("<c:key>Status</c:key>");
request.push("<c:valuei:type=\"a:OptionSetValue\">");
request.push("<a:Value>3</a:Value>");//Qualified
request.push("</c:value>");
request.push("</a:KeyValuePairOfstringanyType>");
request.push("<a:KeyValuePairOfstringanyType>");
request.push("<c:key>transactioncurrencyid</c:key>");
request.push("<c:valuei:type=\"a:Lookup\">");
request.push("<a:Value>"Xrm.Page.getAttribute("transactioncurrencyid")"</a:Value>");
request.push("</c:value>");
request.push("</a:KeyValuePairOfstringanyType>");
request.push("</a:Parameters>");
request.push("<a:RequestIdi:nil=\"true\"/>");
request.push("<a:RequestName>QualifyLead</a:RequestName>");
request.push("</request>");
request.push("</Execute>");
request.push("</s:Body>");
request.push("</s:Envelope>");

Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>