Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Answered

Fetch XML 'Invalid URI: The Uri string is too long.' to populate a subgrid with setFilter

Posted on by 35

Hello,

first, the scenario:

A javascript web resource receives Guids of companies located within a selected area of an html map resource. These are filtered and used to populate a subgrid with the following code snippet:

var fetchXML = '';
for (var i = 0; i < IDs.length; i  ) {
      if (IDs[i] != null) {
        fetchXML  =
          '';
      }
    }
fetchXML  = "";
gridContext.setFilterXml(fetchXML);
gridContext.refresh();
I've seen this  forum response but as I'm trying to populate a subgrid with given Guids through setFilter a batch request seems a bit far fetched.
Is there a way to append data to a subgrid, similar to paging results?
Another way to handle the error could be an option to download the results as an excel sheet but is that even adressable from a javascript resource?
 
 
  • polyester Profile Picture
    polyester 35 on at
    RE: Fetch XML 'Invalid URI: The Uri string is too long.' to populate a subgrid with setFilter

    Hello,

    thanks for the quick reply!

    I've implemented 'in' and the limit is now reached after a little under 3 times the ids as before, which helps atm.

    I've also implemented a batch request which is currently in debugging state.

    As there is no documentation for the setFilterXml on subgrids i actually wonder wether this function takes a batch request as an argument.

    The SSRS suggestion was completely new to me and I'll be reading into it a bit more before implementing.

    p.s. I'll wait a bit for an answer to the setFilterXml and batch request problem and elsewise mark this as verified.

  • Verified answer
    Wahaj Rashid Profile Picture
    Wahaj Rashid 11,319 on at
    RE: Fetch XML 'Invalid URI: The Uri string is too long.' to populate a subgrid with setFilter

    Hi,

    Thank you for your query.

    As far as I understand, your problem is not large dataset so there is no need of paging here..

    Your request is to big for GET, your options are:

    • Either use batch (as mentioned in the forum response)
    • Or try using IN on accountid (instead of eq).

    Instead of thinking about a file download, you can create a SSRS Report and launch it by passing parameters?

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,570 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,683 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans