web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :

JavaScript to Set IFRAME in Microsoft CRM 2013 and CRM for Tablets

Frank Lee Profile Picture Frank Lee 4,617

One of my clients asked to emb an IFrame in a CRM Account Form with a URL containing a specific Query String value from one of the Account record fields.  This is a pretty straight forward JavaScript. 

The CRM JavaScript to leveage is:  Xrm.Page.ui.controls.get(“IFRAME_[Insert Name]“).setSrc([Insert URL]);

However, the challenge with CRM 2013 or CRM Online is that CRM for Tablets doesn’t support IFrame at this time and therefore the above JavaScript will produce an error when opening an Account record on CRM for Tablets.  Here is the link for details on what code can run in CRM for Tablets.

image

The approach would be to check for CRM for Tablets and if it is, don’t run the IFrame portion of the JavaScript code.  Here is an example from Write and debug scripts for CRM for tablets:

var isCrmForTablets = (Xrm.Page.context.client.getClient() == “Mobile”);
if (isCrmForTablets)
{
  // Code for CRM for Tablets only goes here
}
else
{
  // Code for web browser or Outlook Client only goes here
}
// Code for any Client goes here

 

 

Contact me if you are looking for help with your CRM Online.

Frank Lee, Microsoft CRM MVP since 2006
Workopia, Inc. – Dynamics CRM Online Specialist, San Francisco



This was originally posted here.

Comments

*This post is locked for comments

  • Community Member Profile Picture Community Member
    Posted at

    Pingback from  JavaScript to Set IFRAME in Microsoft CRM 2013 and CRM for Tablets » Veille CRM

  • Community Member Profile Picture Community Member
    Posted at

    Pingback from  JavaScript to Set IFRAME in Microsoft CRM 2013 and CRM for Tablets |