locked
CRM 4.0 outlook client synchronization events RRS feed

  • Question

  • Hi There,

    I'm currently in the processing assessing the advanced functionality of the outlook client for crm 4.0. Is there any possibility to handle the synchronization events from the client?
    Shamira Fernando MCPD, MCTS, SCJP
    Friday, October 2, 2009 5:44 AM

Answers

  • Hi Shamira,

    so you want to hook into the synchronization when going online in order to set the appropriate order numbers?

    What you can do is to create a plugin which hooks into the message create/update. You have to ensure that the plugin is only registered on the server. If a client comes back online, all actions which are executed while offline are executed a second time for the synchronization. This means your plugin gets triggered.

    In the plugin you can test for the CallerOrigin (snippet is part of an sdk example) and adjust the order number according your needs

    public void Execute(IPluginExecutionContext context)
    {
     // Check to see if this is a playback context
     CallerOrigin callerOrigin = context.CallerOrigin;
    	
     if (callerOrigin is OfflineOrigin)
     {
      // This plugin was fired from the playback queue after the user
      // selected to go ONLINE within the Outlook client.
      { Logic for adjusting the order numer}
    }

    • Marked as answer by Jim Glass Jr Tuesday, October 6, 2009 6:07 PM
    Monday, October 5, 2009 11:43 AM

All replies

  • Hi Shamira,

    do you mean, you would like to trigger the sychronization by custom code? See http://msdn.microsoft.com/en-us/library/cc151058.aspx
    Friday, October 2, 2009 6:41 AM
  • Hi Christoph, I basically don't want to write the whole synch process by myself, but just want to person some validations prior to synching offline changes. Basically I will have a couple of remote users who will enter Order data via offline outlook client. At the Order creation the OrderNumber will be set to (for example) ORD-x0001. But the actual logic behind the creation of the OrderNumber would be Last Order Number + 1. Since this is an offline user he's not capable of querying the server for the last Order number which was entered. Another user might have entered the last order from the crm online. So when synchronizing this record, I want to grab the latest order number from a web service and modify the offline record and then make the sync. Do you see any other way that I could utilize? Thanks in advance.
    Shamira Fernando MCPD, MCTS, SCJP
    Monday, October 5, 2009 9:26 AM
  • Hi Shamira,

    so you want to hook into the synchronization when going online in order to set the appropriate order numbers?

    What you can do is to create a plugin which hooks into the message create/update. You have to ensure that the plugin is only registered on the server. If a client comes back online, all actions which are executed while offline are executed a second time for the synchronization. This means your plugin gets triggered.

    In the plugin you can test for the CallerOrigin (snippet is part of an sdk example) and adjust the order number according your needs

    public void Execute(IPluginExecutionContext context)
    {
     // Check to see if this is a playback context
     CallerOrigin callerOrigin = context.CallerOrigin;
    	
     if (callerOrigin is OfflineOrigin)
     {
      // This plugin was fired from the playback queue after the user
      // selected to go ONLINE within the Outlook client.
      { Logic for adjusting the order numer}
    }

    • Marked as answer by Jim Glass Jr Tuesday, October 6, 2009 6:07 PM
    Monday, October 5, 2009 11:43 AM