web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
    RE: invalid fetch xml error

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

    community.dynamics.com/.../882775

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

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 159

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 152

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 134 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans