locked
How to make XRM (ASP.NET MVC) application available Offline? RRS feed

  • Question

  • Hi,

    I was wondering if someone can point me to resources which will help me to write an offline XRM application in ASP.NET MVC.

    Our client is looking for a solution which uses CRM data but wants to access it on the road.

    Thanks.

    Tuesday, September 13, 2011 12:55 PM

Answers

  • Hi it is exactly same like any other web app with few differences

    1. Check if the sytem is online then use server webserver services otherwise use the localhost webservices from clients machine.
    2. you need to deploy this on every offline client.

    Here is some information about offline web app in crm 4.0. I believe the concept will be the same in crm2011.

    Microsoft Dynamics CRM 4.0 enables you to write an ASP.NET application and put it on the offline client's Web server. This application can call the offline Web service platform to perform operations against Microsoft Dynamics CRM. These files are deployed in the [Program Files]\Microsoft Dynamics CRM\Client\res\Web\ISV\[Company Name]\[Application Name]. Typically you can use Windows Installer to distribute these files to clients.

    When you execute your code offline there are several things that you need to know:

    The organization name. You get this from the Registry.

    The port number used by the local Web server. Typically, this is 2525.However, you should always check the registry in case there is an abnormal installation.

    The service URLs. You can construct these by concatenating http://localhost + Port Number + the service path.

    You always use Integrated Windows Authentication to access the offline Web services, regardless of the authentication type on the server (including Microsoft Dynamics CRM Online). You also don't have to wrap your code with a CrmImpersonator block. However if you do so, there is no harm. If you write symmetrical code for online/offline, make sure that you don't create the token using the ExtractCrmAuthenticationToken method because this is not available offline. You may want to check to see if the code is executing offline. One way to do this is to see if the Request.Url.Host is 127.0.0.1.

    Here is the link

    http://msdn.microsoft.com/en-us/library/dd393301.aspx

    I hope this helps.


    Amreek singh Senior CRM Consultant CDC Praxa Sydney,Australia http://mscrmshop.blogspot.com/
    • Proposed as answer by Amreek Singh Tuesday, September 13, 2011 1:55 PM
    • Marked as answer by sagarkale Tuesday, September 13, 2011 11:44 PM
    Tuesday, September 13, 2011 1:55 PM

All replies

  • Why wouldn't they just use the Outlook client for Dynamics CRM as it allows offline mode and synchronization capability?

    If that is not an option you would need to write your own synchronizing asp.net client that would be hosted on a users local IIS.  This would be easiest achieved by maintaining a separate database with a set of tables that contains your CRM data that is synchronized to your CRM server using Scribe, or some other tool that you could even build using the CRM web services.  Then you local web app could use something like the sync framework to sync up the local database with the database that contains the CRM data you are maintaining.

    I still recommend the outlook client though: http://www.microsoft.com/download/en/details.aspx?id=10676


    Jamie Miley
    Check out my about.me profile!
    http://mileyja.blogspot.com
    Linked-In Profile
    Follow Me on Twitter!
    Tuesday, September 13, 2011 1:45 PM
    Moderator
  • Hi it is exactly same like any other web app with few differences

    1. Check if the sytem is online then use server webserver services otherwise use the localhost webservices from clients machine.
    2. you need to deploy this on every offline client.

    Here is some information about offline web app in crm 4.0. I believe the concept will be the same in crm2011.

    Microsoft Dynamics CRM 4.0 enables you to write an ASP.NET application and put it on the offline client's Web server. This application can call the offline Web service platform to perform operations against Microsoft Dynamics CRM. These files are deployed in the [Program Files]\Microsoft Dynamics CRM\Client\res\Web\ISV\[Company Name]\[Application Name]. Typically you can use Windows Installer to distribute these files to clients.

    When you execute your code offline there are several things that you need to know:

    The organization name. You get this from the Registry.

    The port number used by the local Web server. Typically, this is 2525.However, you should always check the registry in case there is an abnormal installation.

    The service URLs. You can construct these by concatenating http://localhost + Port Number + the service path.

    You always use Integrated Windows Authentication to access the offline Web services, regardless of the authentication type on the server (including Microsoft Dynamics CRM Online). You also don't have to wrap your code with a CrmImpersonator block. However if you do so, there is no harm. If you write symmetrical code for online/offline, make sure that you don't create the token using the ExtractCrmAuthenticationToken method because this is not available offline. You may want to check to see if the code is executing offline. One way to do this is to see if the Request.Url.Host is 127.0.0.1.

    Here is the link

    http://msdn.microsoft.com/en-us/library/dd393301.aspx

    I hope this helps.


    Amreek singh Senior CRM Consultant CDC Praxa Sydney,Australia http://mscrmshop.blogspot.com/
    • Proposed as answer by Amreek Singh Tuesday, September 13, 2011 1:55 PM
    • Marked as answer by sagarkale Tuesday, September 13, 2011 11:44 PM
    Tuesday, September 13, 2011 1:55 PM
  • Awesome, thanks. Great ho!
    Tuesday, September 13, 2011 11:44 PM