Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Pass record GUID to IFRAME report - Error: The expected parameter has not been supplied

Posted on by 280

Hello,

I have created a report in VS with a parameter of the record ID.  I have added this to an IFRAME on an entity and works fine when the ID is manually entered on the report but when the parameter is hidden it doesn't pull the GUID.

IFRAME Properties:

URL: about:blank
Pass record object: Un-ticked
Restrict cross-frame: Un-ticked

JavaScript:

 var iframeObject = Xrm.Page.getControl("IFRAME_Customer_Report");

 if (iframeObject != null) {
  var strURL = "/CRMReports/viewer/viewer.aspx"
  + "?action=run&context=records&helpID="
  + "Customer_Report"
  + ".rdl&id=%7b"
  + "BAAA0325-B7EE-E611-80DD-00155B0A5A09"
  + "%7d&records="
  + Xrm.Page.data.entity.getId()
  + "&recordstype=1";

 //Set URL of iFrame
 iframeObject.setSrc(strURL);
 }

I'm not sure if it's the javascript above that's incorrect as I found this online.

*This post is locked for comments

  • Charlotte Henighan Profile Picture
    Charlotte Henighan 280 on at
    RE: Pass record GUID to IFRAME report - Error: The expected parameter has not been supplied

    Looking at the URL created it shows that the javascript is running as requested and adding the GUID to the end of the string, but doesn't look like CRM is using this as the parameter value.

    /CRMReports/viewer/viewer.aspx?action=run&context=records&helpID=Customer_Overview.rdl&id=%7bBAAA0325-E7EF-E611-80DD-00155D0A5A09%7d&records=%7bE85B375E-64EC-E611-80DD-00155D0A5A09%7d&recordstype=1

    I'm really lost as most articles I have read, states adding the GUID like this works, wondering if its different in 2011 to 2015. Someone recommended changing 'records' before the GUID to the parameter name will help but then I get another error and the report doesn't load.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Pass record GUID to IFRAME report - Error: The expected parameter has not been supplied

    Hi Charlotte,

    Can you use the encodeURI() method to encode your GUID?

    That JavaScript method will take care of { and }.

    Regards,

    Charmis

  • Charlotte Henighan Profile Picture
    Charlotte Henighan 280 on at
    RE: Pass record GUID to IFRAME report - Error: The expected parameter has not been supplied

    The value brings back { } either side of the ID, will this cause an issue?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Pass record GUID to IFRAME report - Error: The expected parameter has not been supplied

    Hi Charlotte,

    Can you check the value of Xrm.Page.data.entity.getId() (using alert/console.log) before you create the iframeObject variable?

    Regards,

    Charmis

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans