locked
How to know if web client or outlook client RRS feed

  • Question

  • Hello all,

    Is there a way to know from a custom code has been thrown by a web client or an outlook client?

    Because according with the SDK, in a plugin you can test the context (context.IsExecutingInOfflineMode). In javascript you can use IsOnline() function. But all this methods show you if the context is online or offline, but what happens if you want a different behaviour if the client is ie or outlook?

    Friday, February 6, 2009 8:24 AM

Answers

  • Hi Leandro,

    Potentially you might be able to call a web service that is only available on the server. If you receive a response, you will be know that the client is not offline. In such an instance you can connect to the live server.

    If however you don't receive a response, you can connect to the local page. Alternately you can call your custom aspx page on the local machine which calls the server (and if there is a response), forwards you to the server.

    Would that help?

    Thanks,

    Karlo



    Karlo Swart - http://www.ver206.com
    Friday, February 6, 2009 10:55 AM

All replies

  • Hi Leandro,

    The Outlook client accesses MS CRM through IE. Could you explain the context? Perhaps that will give me an idea of what you're trying to achieve.

    Thanks,

    Karlo

    Karlo Swart - http://www.ver206.com
    Friday, February 6, 2009 8:50 AM
  • Hi,

    I know my context is a bit strange, but for example if from a machine with outlook with offline access i use the web access also, and i have a custom aspx page. How can i know distinguish between if the code is been executing by the web access or the outlook online client or if the code is executing offline.

    The idea is have the same code in client and server, so it is needed  a way to differenciate in order to use on eurl or another to the web services.
    Friday, February 6, 2009 9:44 AM
  • Hi Leandro,

    Potentially you might be able to call a web service that is only available on the server. If you receive a response, you will be know that the client is not offline. In such an instance you can connect to the live server.

    If however you don't receive a response, you can connect to the local page. Alternately you can call your custom aspx page on the local machine which calls the server (and if there is a response), forwards you to the server.

    Would that help?

    Thanks,

    Karlo



    Karlo Swart - http://www.ver206.com
    Friday, February 6, 2009 10:55 AM
  • You should use the IsOutlookClient, IsOutlookLaptopClient,IsOutlookWorkstationClient global functions.
    the functions are part of the CRM SDK.

    Friday, February 6, 2009 7:42 PM
  • Hi,

    That global functions are for the script part. My idea was to guess the client type with some object like the CrmOutlookService.IsCrmClientLoaded, but this doesn't work as i would like, so i'll try Karlo's suggestion.

    Thanks for the answers
    Monday, February 9, 2009 8:16 AM