Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

invalid fetch xml error

(0) ShareShare
ReportReport
Posted on by 255

fetchxmlAccholding = @"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false' {0}>
<entity name='new_productholding'>
<attribute name='new_productholdingid' />
<attribute name='new_name' />
<attribute name='createdon' />
<order attribute='new_name' descending='false' />
<filter type='and'>
<condition attribute='new_clientid' operator='eq' value=""" + ClientId + @""" />
<condition attribute='new_clientcaseid' operator='eq' value=""" + ClientCaseId + @""" />
</filter>
<link-entity name='new_casestage' from='new_casestageid' to='new_remediationstatusid' alias='ad'/>
<attribute name='new_casestagename' />
</link-entity>

</entity>
</fetch>";

can any body tell me why this gfetch is invalid i am getting error in plugin

  • Suggested answer
    ajyendra Profile Picture
    1,738 on at
    RE: invalid fetch xml error

    Hi,

    Try this,

    string fetchxmlAccholding = string.Format(@"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
    <entity name='new_productholding'>
    <attribute name='new_productholdingid' />
    <attribute name='new_name' />
    <attribute name='createdon' />
    <order attribute='new_name' descending='false' />
    <filter type='and'>
    <condition attribute='new_clientid' operator='eq' value='{0}' />
    <condition attribute='new_clientcaseid' operator='eq' value='{1}' />
    </filter>
    <link-entity name='new_casestage' from='new_casestageid' to='new_remediationstatusid' alias='ad'/>
    <attribute name='new_casestagename' />
    </link-entity>

    </entity>
    </fetch>",ClientId ,ClientCaseId );

    {0} in the First Line of your Fetch xml is you use it or  put that mistaken if you have some value on that so please use below code

    string fetchxmlAccholding = string.Format(@"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false' {0}>
    <entity name='new_productholding'>
    <attribute name='new_productholdingid' />
    <attribute name='new_name' />
    <attribute name='createdon' />
    <order attribute='new_name' descending='false' />
    <filter type='and'>
    <condition attribute='new_clientid' operator='eq' value='{1}' />
    <condition attribute='new_clientcaseid' operator='eq' value='{2}' />
    </filter>
    <link-entity name='new_casestage' from='new_casestageid' to='new_remediationstatusid' alias='ad'/>
    <attribute name='new_casestagename' />
    </link-entity>

    </entity>
    </fetch>",HERE PUT THAT VARIABLE,ClientId ,ClientCaseId );

  • erhan.keskin Profile Picture
    2,253 on at
    RE: invalid fetch xml error

    Hi,

    You have a parameter in the fetch tag as "{0}", and you don't populate anything into that parameter. It may cause the issue here.

    Regards,

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: invalid fetch xml error

    Please have a look below  thread I have mentioned  sample fetchXMLwith parameter-

    community.dynamics.com/.../882775

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 83

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 78 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans