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

Announcements

News and Announcements icon
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

I have the same question (0)
  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

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

    community.dynamics.com/.../882775

  • erhan.keskin Profile Picture
    2,253 on at

    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
    ajyendra Profile Picture
    1,738 on at

    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 );

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Nagaraju_Matta Profile Picture

Nagaraju_Matta 121

#2
ManoVerse Profile Picture

ManoVerse 67 Super User 2026 Season 1

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 66 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans