Retrieving Fetch XML in Rollup 12

Proposed Retrieving Fetch XML in Rollup 12

  • Friday, March 15, 2013 7:09 PM
     
     

    We have a Ribbon button displayed on our Contact entity that we use to launch an ASP.NET webpage. Before Rollup 12, we could use document.getElementById('FetchXml') to retrieve the Fetch XML that was being ran for a particular Advanced Find and then in turn pass that as a query string parameter to our ASP.NET webpage. We used this to loop through all of the results of the Advanced Find and perform a certain action. This functionality no longer works as document.getElementById('FetchXml') now returns null/undefined. I've tried to dig through the DOM using the IE Dev Tools to try to find another way to pull back that Fetch XML but have been unsuccessful. Does anyone have a way to do this? If not, what alternatives do I have to pass the FetchXML to an ASP.NET page.

    Thanks

All Replies

  • Saturday, March 16, 2013 8:51 AM
     
     

    Is this button on the main page/grid view ribbon?

    I'm looking at a rollup 5 instance and I don't see anything with the ID 'FetchXml' from advanced find results.

    Paul

  • Tuesday, March 19, 2013 5:45 AM
     
     
    The ID 'FetchXml' was available on Advanced Find result pages from the Grid View ribbon (prior to R12). It didn't populate on the regular Grid View (ie not-Advanced Find) or the Main Page.
  • Tuesday, March 19, 2013 5:47 AM
     
     

    I was looking at advanced find results and couldn't see it. Are you able to screenshot the HTML from devtools on rollup 5 to show where the ID is being used?

    Paul

  • Tuesday, March 19, 2013 7:45 AM
     
     Proposed

    try with following 

    var x = Sys.Application.findComponent('FetchXml');


    Thomas T(MCBMSS) If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".

  • Tuesday, March 19, 2013 10:18 AM
     
      Has Code

    I've had another look at this and was able to find the element. It seems the ID is now just 'fetchXml' (no capital 'f').

    So from the ribbon button for example you can do this to get the advanced find XML:

    var fetch = document.getElementById('fetchXml');
    if (fetch != null) {
        var xml = fetch.getAttribute('value'); //the fetchXml used in the advanced find
    }

    I've tested this in IE10 and Chrome and both work.

    To make it backward compatible you could first get the old ID, and if that's null try getting the new ID.

    Hope that helps

    Paul