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 -
- Account
- new_completedcallreport - custom entity
- Opportunity
------------------------------------
Need to show custom entity records on Opportunity based on matching Account value.
Help in this regard is highly appreciated.
Error Details:
--------------------------------------------------------------------------------------------------
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);
}
------------------------------------------------------------------------------------