web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

SOAP to ODATA

(0) ShareShare
ReportReport
Posted on by

Hi,

Can anyone help me with this?

I want the ODATA Query for the following SOAP request.

var xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +

"<soap:Envelope xmlns:soap=\"schemas.xmlsoap.org/.../envelope\" xmlns:xsi=\"www.w3.org/.../XMLSchema-instance\" xmlns:xsd=\"www.w3.org/.../XMLSchema\">" +

Xrm.Page.context.getAuthenticationHeader() +

" <soap:Body>" +

" <RetrieveMultiple xmlns=\"schemas.microsoft.com/.../WebServices\">" +

" <query xmlns:q1=\"schemas.microsoft.com/.../Query\" xsi:type=\"q1:QueryExpression\">" +

" <q1:EntityName>scas_applicationpayment</q1:EntityName>" +

" <q1:ColumnSet xsi:type=\"q1:ColumnSet\">" +

" <q1:Attributes>" +

" <q1:Attribute>scas_applicationpaymentid</q1:Attribute>" +

" </q1:Attributes>" +

" <q1:Attributes>" +

" <q1:Attribute>scas_claimid</q1:Attribute>" +

" </q1:Attributes>" +

" </q1:ColumnSet>" +

" <q1:Criteria>" +

" <q1:FilterOperator>And</q1:FilterOperator>" +

" <q1:Conditions>" +

" <q1:Condition>" +

" <q1:AttributeName>scas_applicationid</q1:AttributeName>" +

" <q1:Operator>Equal</q1:Operator>" +

" <q1:Values> " +

" <q1:Value xsi:type=\"xsd:string\">" + Xrm.Page.data.entity.getId() + "</q1:Value>" +

" </q1:Values>" +

" </q1:Condition>" +

" </q1:Conditions>" +

" </q1:Criteria>" +

" <q1:LinkEntities>" +

" <q1:LinkEntity>" +

" <q1:LinkFromAttributeName>scas_claimid</q1:LinkFromAttributeName>" +

" <q1:LinkFromEntityName>scas_applicationpayment</q1:LinkFromEntityName>" +

" <q1:LinkToEntityName>scas_claim</q1:LinkToEntityName>" +

" <q1:LinkToAttributeName>scas_claimid</q1:LinkToAttributeName>" +

" <q1:JoinOperator>Inner</q1:JoinOperator>" +

" <q1:LinkCriteria>" +

" <q1:FilterOperator>And</q1:FilterOperator>" +

" <q1:Conditions>" +

" <q1:Condition>" +

" <q1:AttributeName>scas_claimstatus</q1:AttributeName>" +

" <q1:Operator>Equal</q1:Operator>" +

" <q1:Values> " +

" <q1:Value xsi:type=\"xsd:string\">" + claimStatusSubmitted + "</q1:Value>" +

" </q1:Values>" +

" </q1:Condition>" +

" </q1:Conditions>" +

" </q1:LinkCriteria>" +

" </q1:LinkEntity>" +

" </q1:LinkEntities>" +

" </query>" +

"</RetrieveMultiple>" +

" </soap:Body>" +

"</soap:Envelope>" +

"";

 

 

 

Regards

Sagar

 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    anilambadan Profile Picture
    1,160 on at

    Hi Sagar

    You can use OData Query designer to build the query easily. Its available on codeplex.

    Please use the following link

    https://crm2011odatatool.codeplex.com/

    thanks

    Anil

  • Community Member Profile Picture
    on at

    Hi Anil, thanks for your answer.

    But my problem is - I Have to convert already existing SOAP requests to ODATA query.

    I am stuck in this one, Specially in LinkEntities Node and its filter criteria.

    If you have any syntax for the above SOAP query then it will be really helpful.

    Regards

    Sagar

  • Royal King Profile Picture
    27,686 on at

    You can covert this query easily to ODATA using below tool, this also allows you test the result .

    https://crmrestbuilder.codeplex.com/

  • Community Member Profile Picture
    on at

    This is rest Builder Chitrarasan, I want the ODATA query.

    And I already have a tool, but what I need is to convert the above code into ODATA query, can you provide me the query?

    Regards

    Sagar

  • anilambadan Profile Picture
    1,160 on at

    Hi Sagar,

    I will not be able to build the query for you because I haven't got the same entities with me. Have you tried to install the OData Query Designer and its very easy to build the query and you can include link entites also in the tool. Please see the screen shot below

    link.PNG

  • Royal King Profile Picture
    27,686 on at

    ODATA  is a REST. Odata needs schema name of the entity and attributes so i can't provide odata query without schema name of the entities and difleds used in your fetchxml. Tool is very easy to use just like advance find. Select right entity and add conditions and click on create query that will generate odata query

  • Community Member Profile Picture
    on at

    Hi anil, thanks a lot, it was really helpful.

    I was able to associate a related entity(link entity i.e scas_claim in above scenario )

    But, see below that, there is a condition "scas_claimstatus" should be equal to "claimstatussubmitted"

    I Dont know how to put a condition for the link entities, it will be helpful if you can share. A screenshot for that.   Yes I used the tool.

  • Community Member Profile Picture
    on at

    hi anil, can you please help me with the query, i am new to ODATA

    The problem is  - the condition in link entities, how to achieve that?

  • anilambadan Profile Picture
    1,160 on at

    You will be able to specify the condition like $filter='relationshipname'/attributename eq 'value'

  • Community Member Profile Picture
    on at

    we are also using one filter above, so the second wont give any problems?

    and this filter to check related entites will be written after "$expand" keyword?

    So the query may look like this - entitySet/$select=AttributeNames $filter="FirstchekCondition" $Expand = "Relationshipname" $filter = 'relationshipname'/attributename eq 'value'

    Something like the above query??

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans