Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

detect web client vs desktop client with visual studio tools

(0) ShareShare
ReportReport
Posted on by 95

Can you detect the client type in visual studio tools?

Ultimately, I'm looking to create links as buttons on GP forms to open external web sites, but the way i do it on a desktop client (using an old fashioned ShellExecuteA) doesn't work in the web client.

i'd hope to detect the webclient in code to be able to alter the method used to open the web site.

Any suggestions?

Thanks

Categories:
  • Suggested answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,957 Most Valuable Professional on at
    RE: detect web client vs desktop client with visual studio tools

    Hi Jeff

    You can also use the Dynamics.Functions.IsWebClient.Invoke() function

    This is what we use from Dexterity.

    Regards

    David

  • Suggested answer
    Jeff M Profile Picture
    Jeff M 95 on at
    RE: detect web client vs desktop client with visual studio tools

    Finally found this:

    community.dynamics.com/.../355733

    int iClientType = Dynamics.Forms.SyVisualStudioHelper.Functions.DexRuntimeGetClientType.Invoke();
    String sWebSite = ;
    
    if (iClientType == 1) //Desktop Client
        Process.Start(sWebSite);
    else //Web Client
        Dynamics.Forms.SyVisualStudioHelper.Functions.DexUtilityLaunchUrl.Invoke(sWebSite);
    

    Does what i needed

    Thanks

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans