Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

iFrame behavior in CRM2016 when passing parameters

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi
I have a problem behavior with iFrame after migrate 2015 to 2016 SP1 (both on-premises).
I read various articles about Microsoft change on 2015 SP1 but nothing explain that.
Think in one tab (collapsed by default) that have one iFrame. This iFrame is checked to pass parameters.
The TabStateChange in the tab call this code:

var IFrame = Xrm.Page.ui.controls.get(frame);
IFrame.setSrc('customized_page.html');

When expand the tab, the above code is called. After the first execution the address of the iFrame is:
"customized_page.html"

If I collapse and expand this the result for the same code is:
"customized_page.html?OrgLCID=1046&UserLCID=1046&id=%7bB3FBE90D-AC21-E611-80CC-00155D963719%7d&orgname=Cotonso&type=1010&typename=contract"

Why the parameters are not appended in the first execution ?

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: iFrame behavior in CRM2016 when passing parameters

    The problem was bypassed with the system parameter.
    Settings -> Administration -> System Settings -> General. Select “Yes” under “Use legacy form rendering”.
    Theses resource disable this behavior (returning like 2015 version). These approach lose the implementation made by Microsoft like link bellow.
    https://blogs.msdn.microsoft.com/crm/2015/04/29/microsoft-dynamics-crm-online-2015-update-1-new-form-rendering-engine/

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: iFrame behavior in CRM2016 when passing parameters

    This doesnt work because the behavior is the same in all frames at the same screen.

    If the parameters are loaded in first call I would be saved it. But what occurs here is the opposite.

    Tks

  • Andreas Cieslik Profile Picture
    Andreas Cieslik 9,267 on at
    RE: iFrame behavior in CRM2016 when passing parameters

    so why can't you backup the parameters in a global JavaScript variable and use it for the next iframe setsrc call?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: iFrame behavior in CRM2016 when passing parameters

    This is not applied in my case, but thanks for the suggestion.

  • Suggested answer
    Andreas Cieslik Profile Picture
    Andreas Cieslik 9,267 on at
    RE: iFrame behavior in CRM2016 when passing parameters

    instead you could save the parameters in a global JavaScript variable, if that is suitable for your application.

    Then you can use this global variable multiple times.

    Maybe this blog can guide you also:

    http://butenko.pro/2015/03/howto-htmljs-webresources/

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: iFrame behavior in CRM2016 when passing parameters

    Hi Andreas.

    Thanks for your suggestions but I already tried this.

    This approach works fine in CRM2015. But in CRM2016 this line:

    var Url = IFrame.getSrc();

    Getting Url value it is without the parameters. This behavior is only in the first call.

  • Andreas Cieslik Profile Picture
    Andreas Cieslik 9,267 on at
    RE: iFrame behavior in CRM2016 when passing parameters

    Hi,

    On first execution it seems you do not pass parameters within your code.

    You should use code similar to the one below:

      var ordername = Xrm.Page.getAttribute("name").getValue();

      var IFrame = Xrm.Page.ui.controls.get("IFRAME_sendvalue");

      var Url = IFrame.getSrc();

      if (Url.indexOf("?") != -1)

          Url = Url.substr(0, Url.indexOf("?"));

      var param1 = Url+"?ordername="+ordername;

      IFrame.setSrc(param1);

    This will take the original parameters and then you pass them to your own call of iframe.setSrc(..).

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,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,356 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans