Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Help me to correct FetchXML code

Posted on by 815

Hi,

Please find the below code :

<fetch>
<entity name="new_vjxquote" >
<attribute name="new_name" />
<link-entity name="new_vjxproducts" from="new_quoteid" to="new_vjxquoteid" >
<attribute name="new_item" />
<attribute name="new_name" />
<attribute name="new_quantity" />
<attribute name="new_unitprice" />
</link-entity>
</entity>
</fetch>

Requirement is : Based on Quote ID, following item should appear on the table i.e Item #, Description, Quantity and Unit Price. I have write the code os this correct or pl help me for condition filter.

*This post is locked for comments

  • Syed_Faisal Profile Picture
    Syed_Faisal 815 on at
    RE: Help me to correct FetchXML code

    Hi Ravi and Pravin,

    FetchXML query works fine on the tool but if i use the same code on the SSRS report then required field data is not populating.

    What i have noticed here, link entity entity data is not populating on the report, something is restricting to populate data.

    Regards

    Faisal

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Help me to correct FetchXML code

    Hi Syed,

    The easiest way is to build your query in Advance Find. This way you can run it and see if you are getting the desired results or now. Once done, you can then download the fetchxml query. For your current scenario, the query shared by Mahadeo should work.

    Hope this helps.

  • Suggested answer
    Pawar Pravin  Profile Picture
    Pawar Pravin 5,227 on at
    RE: Help me to correct FetchXML code

    Hi Syed,

    As suggested by Mahadeo, please try once using advance find. While downloading fetchxml from advance find you will be able to see distinct changes.

    For ex,

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">

     <entity name="account">

       <attribute name="name" />

       <attribute name="primarycontactid" />

       <attribute name="telephone1" />

       <attribute name="accountid" />

       <order attribute="name" descending="false" />

     </entity>

    </fetch>

  • Suggested answer
    Mahadeo Matre Profile Picture
    Mahadeo Matre 17,021 on at
    RE: Help me to correct FetchXML code

    Hi Syed,

    you can create same query from Advanced find and add condition there. or try below FetchXML


    <fetch>
    <entity name="new_vjxquote" >
    <attribute name="new_name" />
    <filter type="and">
    <condition attribute="new_quoteid" operator="eq" uitype="new_vjxquote" value="{6F77A128-3AC8-E811-80D8-005056B1622D}" />
    </filter>
    <link-entity name="new_vjxproducts" from="new_quoteid" to="new_vjxquoteid" >
    <attribute name="new_item" />
    <attribute name="new_name" />
    <attribute name="new_quantity" />
    <attribute name="new_unitprice" />
    </link-entity>
    </entity>
    </fetch>

  • Syed_Faisal Profile Picture
    Syed_Faisal 815 on at
    RE: Help me to correct FetchXML code

    Hi Mahadeo,

    Above XML code was created from XRMToolbox only, the place where i got stuck was about the condition, where i need help.

  • Suggested answer
    Mahadeo Matre Profile Picture
    Mahadeo Matre 17,021 on at
    RE: Help me to correct FetchXML code

    Hi,

    easy way to create fetchxml is created required query in adavnced find, and from advanced find you can download FetchXML.

    us.hitachi-solutions.com/.../great-fetchxml-tool-for-microsoft-dynamics-crm

    hope this will help..

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans