Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Xrm.Page.context.client.getClient() returns "Web" when called from Outlook App

Posted on by Microsoft Employee

Hi,

The Xrm.Page.context.client.getClient() function does not seem to be working correctly. When called from the desktop Outlook App, it returns "Web", instead of "Outlook" as described by the documentation (https://msdn.microsoft.com/en-us/library/gg334511.aspx#BKMK_getclient). Here is the code I am using (bound to form onLoad event):

function alertClient() {
var client = Xrm.Page.context.client.getClient();
Xrm.Utility.alertDialog(client);
}

Any ideas on why this is happening?

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Xrm.Page.context.client.getClient() returns "Web" when called from Outlook App

    We are using the "Dynamics 365 app for Outlook".

  • Suggested answer
    Nicolas.Plourde Profile Picture
    Nicolas.Plourde 240 on at
    RE: Xrm.Page.context.client.getClient() returns "Web" when called from Outlook App

    Can you mention which app you use? There is two: The "Dynamics 365 for Outlook" or the "Dynamics 365 app for Outlook".

    I'm not sure if nowaday this function still returns "Outlook". Now, everything runs in an iframe in Outlook. Before the add-on had a different architecture.

    As a solution, maybe if you parse the url from Outlook you could find a specific parameter that would tell you the source. That's probably how Dynamics would do it anyway.

  • Suggested answer
    Adrian Begovich Profile Picture
    Adrian Begovich 21,009 Super User 2024 Season 2 on at
    RE: Xrm.Page.context.client.getClient() returns "Web" when called from Outlook App

    Hi Wesley Thorsen,

    The Xrm.Page.context.client.getClient(); code will return a value to indicate which client the script is executing in. If it is not returning the correct value then it is likely to be a bug that needs to be raised with Microsoft.

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,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans