Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Error on page Subgrid fetchXML

(0) ShareShare
ReportReport
Posted on by 60

Hi everyone

Since the transition from 7 to 13 rollup. The fetch XML query does not work. The red line is the fact that halt program execution. Someone an idea?

thank you

CODE :

//-----------------------------------------------------------------------
var leadGrid = document.getElementById("Products_Associated");

//If this method is called from the form OnLoad, make sure that the grid is loaded before proceeding //Included extra null check as a rollup 5 fix
if (leadGrid == null || leadGrid.readyState != "complete") {
//The subgrid hasn't loaded, wait 1 second and then try again
setTimeout('UpdateSubGrid()', 1000);
return;
}

//Update the fetchXML that will be used by the grid.
var fetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>";
fetchXml += "<entity name='product'>";
fetchXml += "<attribute name='name' />";
fetchXml += "<attribute name='productnumber' />";
fetchXml += "<order attribute='name' descending='false' />";
fetchXml += "<order attribute='productnumber' descending='false' />";
fetchXml += "<link-entity name='geo_expectedrevenue' from='geo_productid' to='productid' alias='aa'>";
fetchXml += "<link-entity name='opportunity' from='opportunityid' to='geo_opportunityid' alias='ab'>";
fetchXml += "<filter type='and'>";
fetchXml += "<condition attribute='geo_accountid' operator='eq' value='";
fetchXml += entity_current_guid;
fetchXml += "' />";
fetchXml += "</filter>";
fetchXml += "</link-entity>";
fetchXml += "</link-entity>";
fetchXml += "<attribute name='productid' />";
fetchXml += "</entity>";
fetchXml += "</fetch>";

//Inject the new fetchXml
leadGrid.control.setParameter("fetchXml", fetchXml);
//Force the subgrid to refresh
leadGrid.control.refresh();

*This post is locked for comments

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,489 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans