Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Unanswered

CRM 2011 SOAP Request

Posted on by 65

Dears 

I have one JS File with SOAP Request.

I want to update the conditions by adding another condition related to optionset field(dropdownlist),

the condition is : new_paymenttype=1

I updated the condition by adding this part but it is not working !!, I am looking for your support 

" <q1:Condition>" +
" <q1:AttributeName>new_paymenttype</q1:AttributeName>" +
" <q1:Operator>Equal</q1:Operator>" +
" <q1:Values>" +
" <q1:Value xsi:type=\"xsd:string\">"+condition+"</q1:Value>" +
" </q1:Values>" +
" </q1:Condition>" +

var Accountxml = "" + "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<soap:Envelope xmlns:soap=\"">schemas.xmlsoap.org/.../\" xmlns:xsi=\"">www.w3.org/.../XMLSchema-instance\" xmlns:xsd=\""">www.w3.org/.../XMLSchema\">" +
authenticationHeader +
" <soap:Body>" +
" <RetrieveMultiple xmlns=\""">schemas.microsoft.com/.../WebServices\">" +
" <query xmlns:q1='schemas.microsoft.com/.../Query' xsi:type='q1:QueryExpression\'>" +
" <q1:EntityName>new_leasepayments</q1:EntityName>" +

" <q1:ColumnSet xsi:type=\"q1:ColumnSet\">" +
" <q1:Attributes>" +
" <q1:Attribute>new_dueamount</q1:Attribute>" +
" <q1:Attribute>new_serialnumber</q1:Attribute>" +
" </q1:Attributes>" +
" </q1:ColumnSet>" +

" <q1:Distinct>false</q1:Distinct>" +

" <q1:PageInfo>" +
" <q1:PageNumber>1</q1:PageNumber>" +
" <q1:Count>1</q1:Count>" +
" </q1:PageInfo>" +

" <q1:Criteria>" +
" <q1:FilterOperator>And</q1:FilterOperator>" +
" <q1:Conditions>" +
" <q1:Condition>" +
" <q1:AttributeName>new_new_leaseagreementinformationid</q1:AttributeName>" +
" <q1:Operator>Equal</q1:Operator>" +
" <q1:Values>" +
" <q1:Value xsi:type=\"xsd:string\">" + contactname + "</q1:Value>" +
" </q1:Values>" +
" </q1:Condition>" +

" <q1:Condition>" +
" <q1:AttributeName>statuscode</q1:AttributeName>" +
" <q1:Operator>Equal</q1:Operator>" +
" <q1:Values>" +
" <q1:Value xsi:type=\"xsd:string\">1</q1:Value>" +
" </q1:Values>" +
" </q1:Condition>" +


" </q1:Conditions>" +
" </q1:Criteria>" +
" </query>" +
" </RetrieveMultiple>" +
" </soap:Body>" +
"</soap:Envelope>" +
"";
// Create an instance of an XMLHTTP object.
var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
xmlHttpRequest.Open(
"POST",
"/mscrmservices/2007/CrmService.asmx",
false
);

xmlHttpRequest.setRequestHeader(
"SOAPAction",
"">schemas.microsoft.com/.../RetrieveMultiple"
);

xmlHttpRequest.setRequestHeader(
"Content-Type", "text/xml; charset=utf-8"
);

xmlHttpRequest.setRequestHeader(
"Content-Length", Accountxml.length
);

// Send the XMLHttp request.
xmlHttpRequest.send(Accountxml);

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans