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)

Getting Invalid XML error when filter sub grid on Opportunity

(0) ShareShare
ReportReport
Posted on by 25

Hi,

Here is my code - I called it on Opportunity Onload. It's working perfectly for most of the opportunity records. I'm seeing weird behavior for only 3-4 opportunities. Tried recreating new account record and associating it with opportunity. Still no luck.

Entities -

  1. Account
  2. new_completedcallreport - custom entity
  3. Opportunity

------------------------------------

Need to show custom entity records on Opportunity based on matching Account value.

Help in this regard is highly appreciated.

Error Details: 

--------------------------------------------------------------------------------------------------

Invalid XML

The XML passed to the platform is not well-formed XML.

Log Details: 

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.Xml.XmlException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #E117C922Detail:
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>System.Xml.XmlException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #E117C922</Message>
<Timestamp>2017-01-16T09:24:21.5070017Z</Timestamp>
<ExceptionSource i:nil="true" />
<InnerFault>
<ErrorCode>-2147220991</ErrorCode>
<ErrorDetails xmlns:d3p1="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>Invalid XML.</Message>
<Timestamp>2017-01-16T09:24:21.5070017Z</Timestamp>
<ExceptionSource i:nil="true" />
<InnerFault>
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:d4p1="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>System.Xml.XmlException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #5F76E46C</Message>
<Timestamp>2017-01-16T09:24:21.5070017Z</Timestamp>
<ExceptionSource i:nil="true" />
<InnerFault i:nil="true" />
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</InnerFault>
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</InnerFault>
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</OrganizationServiceFault>

--------------------------------------------------------------------------------------------------

Code Details

------------------------------------------------------------------------------------------------------

 var fetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>";
        fetchXml += "<entity name='new_completedcallreport'>";
        fetchXml += "<attribute name='new_completed_accountsoldto'/>";
        fetchXml += "<attribute name='new_company'/>";
        fetchXml += "<attribute name='subject'/>";
        fetchXml += "<attribute name='new_materialgroups'/>";
        fetchXml += "<attribute name='new_reasonforcallvalues'/>";
        fetchXml += "<attribute name='new_dateofcall'/>";
        fetchXml += "<attribute name='ownerid'/>";
        fetchXml += "<attribute name='statuscode'/>";
        fetchXml += "<attribute name='new_completed_summary'/>";

        fetchXml += "<order descending='false' attribute='new_dateofcall'/>";
        fetchXml += "<filter type='and'>";
        fetchXml += "<condition attribute='new_completed_accountsoldto' operator='eq' uiname='" + lookupname + "'  uitype='account'   value='" + lookupid + "' />";
        fetchXml += "</filter>";
        fetchXml += "</entity>";
        fetchXml += "</fetch>";
        if (relatedCallReports.control != null)
 {
            relatedCallReports.control.SetParameter("fetchXml", fetchXml); //set the fetch xml to the sub grid
            relatedCallReports.control.Refresh(); //refresh the sub grid using the new fetch xml
        }
        else{
            setTimeout(updateSubGrid, 2000);
        }

------------------------------------------------------------------------------------

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Nithya Gopinath Profile Picture
    17,078 on at

    Hi Keerthi,

    Below tool helps you in validating your fetchxml.

    xrmtoolbox.codeplex.com/.../103974

    Please go through it.

    Also refer the thread below.

    community.dynamics.com/.../143846

    Hope it helps you.

  • Keerthi Thorupunoori Profile Picture
    25 on at

    Thanks Nithya, Solution in this link resolved my issue.

    community.dynamics.com/.../143846

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