Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

Dynamics 365 - JavaScript, Verify if it's Unified Interface or Classic App or Display SharePoint Library on United Interface App

Posted on by 125

Hi,

I have a question relating with processing form context from UI through JavaScript.

Generally I have found that there is an option to use Xrm.Internal.isUci(), but I have found that is unsupported way.

Do you have any other way to detect if the user uses United Interface (HUB) or Classic App? 

Or If it's not possible to detect Context of the form, do you have any way to display sharepoint library directly on the form in United Interface?

I need it, because I have script on account form load, which is loading SharePoint Library:

function setIFrameConent()
{
    if(Xrm.Page.getAttribute("sup_name").getValue() != undefined && Xrm.Page.getAttribute("sup_name").getValue() != null)
    {
      var recordId = Xrm.Page.data.entity.getId().replace("{", "").replace("}", ""); // Entity record Id
      var oTypeCode = Xrm.Page.context.getQueryStringParameters().etc; //Entity Type code. 
      var CurrentFormId = Xrm.Page.ui.formSelector.getCurrentItem().getId().replace("{", "").replace("}", "");
      Xrm.Page.getControl("IFRAME_sharepointlibrary").setSrc(Xrm.Page.context.getClientUrl() + "/userdefined/areas.aspx?formid=" + CurrentFormId + "&inlineEdit=1&navItemName=Documents&oId=%7b" + recordId + "%7d&oType=" + oTypeCode + "&pagemode=iframe&rof=true&security=852023&tabSet=areaSPDocuments&theme=Outlook15White"); // IFRAME_Documents is the name of the Iframe on the form.
    }
    else 
    {
        Xrm.Page.ui.tabs.get("tab_2").setVisible(false);
    }
}

Unfortunately this code works only on classic app, not on United Interface.

Can you help me ?

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Dynamics 365 - JavaScript, Verify if it's Unified Interface or Classic App or Display SharePoint Library on United Interface App

    Hi,

    Its an unsupported code so it is expected not to work. It is also more likely to break in classic interface as well with future updates as it uses internal pages which can be changed anytime.

    So, unfortunately answer to both your queetion is ...No, there is currently no supported way :(

    Hope this helps

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans