Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP forum
Suggested answer

detect web client vs desktop client with visual studio tools

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

  • Suggested answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,781 Super User 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

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,768 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,985 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans