Hi all
I have this code
function filterSubGrid()
{
debugger;
var leadwithSameNameGrid = window.parent.document.getElementById("OrderProduct");
var currentleadId = Xrm.Page.data.entity.getId();;
var AccountName = Xrm.Page.getAttribute('name').getValue();
if (leadwithSameNameGrid == null)
{
setTimeout(filterSubGrid, 2000);
return;
}
//fetch xml code
var contactFetchXML = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>"+
"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>"+
" <entity name='salesorderdetail'>"+
" <attribute name='productid' />"+
" <attribute name='priceperunit' />"+
" <attribute name='quantity' />"+
" <attribute name='manualdiscountamount' />"+
//" <attribute name='salesorderdetailid' />"+
" <attribute name='extendedamount' />"+
" <order attribute='productid' descending='false' />"+
" <link-entity name='salesorder' from='salesorderid' to='salesorderid' alias='ay' link-type='inner'>"+
" <link-entity name='account' from='accountid' to='customerid' alias='az' link-type='inner'>"+
" <filter type='and'>"+
" <condition attribute='accountid' operator='eq' uiname='"+AccountName+"' uitype='account' value='"+currentleadId+"' />"+
" </filter>"+
" </link-entity>"+
" </link-entity>"+
" </entity>"
"</fetch>"
var contactRecords = XrmServiceToolkit.Soap.Fetch(contactFetchXML);
if (leadwithSameNameGrid.control != null)
{
leadwithSameNameGrid.control.SetParameter("fetchXml", contactFetchXML); //set the fetch xml to the sub grid
leadwithSameNameGrid.control.refresh(); //refresh the sub grid using the new fetch xml
}
else
{
setTimeout(filterSubGrid, 2000);
}
}
all my code working fine I have no exceptions in the debugger but my form gives me an error
This is the error on my grid
This seem something could happen if I correct some mistake.
What is wrong. Please help?
This is my error log file result .
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: #80B13758Detail:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>System.Xml.XmlException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #80B13758</Message>
<Timestamp>2016-08-19T12:11:09.2179179Z</Timestamp>
<InnerFault>
<ErrorCode>-2147220991</ErrorCode>
<ErrorDetails xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>Invalid XML.</Message>
<Timestamp>2016-08-19T12:11:09.2179179Z</Timestamp>
<InnerFault>
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:d4p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>System.Xml.XmlException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #90E8797E</Message>
<Timestamp>2016-08-19T12:11:09.2189191Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText i:nil="true" />
</InnerFault>
<TraceText i:nil="true" />
</InnerFault>
<TraceText i:nil="true" />
</OrganizationServiceFault>