locked
CRM2011: Outlook Sync Error: Unable to Cast Object System.DBNull RRS feed

  • Question

  • Hello,

    This is from the log file. I get the error everytime synching with CRM from Outlook (with/without "ignore error" checked)

    Process:OUTLOOK |Organization:eb45dd9c-454a-457f-ab26-e7fb0e62080a |Thread:   25 |Category: Application.Outlook |User: 00000000-0000-0000-0000-000000000000 |Level: Error | EmailSyncTable.GetChanges
     at EmailSyncTable.GetChanges(Int32 type, Int32 priority)
     at ThreadsSupport.ExecuteThreadProc(ThreadProc threadProc, IntPtr parameter)
    >Exception occurred during SQL CE select:System.InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.String'.

    I couldn't find which records are causing this from the log file. I am looking for suggestions on where to locate the bad records.

    Outlook 2003 SP3
    CRM Outlook Client Rollup 7

    Thanks.

    Wednesday, April 25, 2012 10:10 PM

Answers

  • Hanvo,

    Those sqlce files will regenerate after opening outlook. Those sqlce files maintain information about items to sync and items that were sync'd either from crm to outlook or outlook to crm.

    There should not be any negetive effect. I would just double check any items you tracked in outlook during that time and ensure they are in crm. Also, click on the Outlook Menu > CRM > Synchonize with CRM to synchronize any pending items from crm to outlook just in case if some items did not sync while you deleted the *.sdf files.

    Thanks,

    Mithuna



    Friday, April 27, 2012 3:20 AM
  • Hanvo,

    I double checked again. To ensure 100% that you dont have any issues after deleting the sdf files, We suggest you reconfigure your org to regenerate and repopulate old items that were sync'd.

    Here are some details on the internals on how this works and what might be affected if you dont reconfigure at this point:

    There is a table called ID Mapping table in the OutlookSyncCache.sdf which maintains items that were tracked from outlook in the past and also items that were created in crm and sync'd to outlook. CRM relies on this table for information on which items are linked to certain outlook items. So essentially, anytime you update old items in crm which were already syncd to outlook, you might end up with duplicate records in outlook. This is because crm relies on this ID mapping table for this information and does not find it since you have deleted it. To avoid this the best idea is to reconfigure to the same org, which not only regenrates the sdf files but also repopulates all the old Id mapping data.

    Hope this helps!

    Thanks,

    Mithuna



    Monday, April 30, 2012 8:36 PM

All replies

  • Hanvo,

    Could you please clarify a few things for me?

    1. What are the actions you performed before you saw this error?

    2. What is your CRM server and client versions ?

    Thanks,

    Mithuna



    Thursday, April 26, 2012 7:44 AM
  • I got the same problem with one of our users.

    Problem occurs without using CRM functions in Outlook every some minutes.

    Server and Client are on the latest versions (2011, Update Rollup 7). The problem occurs since this update.

    Thursday, April 26, 2012 8:08 AM
  • In our company the problem only occurs on Windows XP machines with Outlook 2007.

    @HanVo: Can you confirm this?

    • Edited by Oliver.Graf Thursday, April 26, 2012 9:29 AM
    Thursday, April 26, 2012 9:29 AM
  • From Outlook Menu > CRM > Synchonize with CRM, then I get the error.

    CRM server is on rollup 5.
    CRM Outlook Client was on rollup 5 but I upgraded it to rollup7 (the issue has happened since rollup 5)
    Client OS is Windows XP
    Outlook 2003

    We have other XP machines with Outlook 2003 but they are ok.

    Thursday, April 26, 2012 5:46 PM
  • I deleted EmailCache.sdf and OutlookSyncCache.sdf then resynched with CRM. I don' t get the error anymore. From the synch window, I see one email synched (to be tracked in CRM) successfully (which I couldn't see before. I beleive this email caused the issue).

    I am not sure if there is any negative effect on deleting those 2 files.

    Thursday, April 26, 2012 7:09 PM
  • Hanvo,

    Those sqlce files will regenerate after opening outlook. Those sqlce files maintain information about items to sync and items that were sync'd either from crm to outlook or outlook to crm.

    There should not be any negetive effect. I would just double check any items you tracked in outlook during that time and ensure they are in crm. Also, click on the Outlook Menu > CRM > Synchonize with CRM to synchronize any pending items from crm to outlook just in case if some items did not sync while you deleted the *.sdf files.

    Thanks,

    Mithuna



    Friday, April 27, 2012 3:20 AM
  • Hanvo,

    I double checked again. To ensure 100% that you dont have any issues after deleting the sdf files, We suggest you reconfigure your org to regenerate and repopulate old items that were sync'd.

    Here are some details on the internals on how this works and what might be affected if you dont reconfigure at this point:

    There is a table called ID Mapping table in the OutlookSyncCache.sdf which maintains items that were tracked from outlook in the past and also items that were created in crm and sync'd to outlook. CRM relies on this table for information on which items are linked to certain outlook items. So essentially, anytime you update old items in crm which were already syncd to outlook, you might end up with duplicate records in outlook. This is because crm relies on this ID mapping table for this information and does not find it since you have deleted it. To avoid this the best idea is to reconfigure to the same org, which not only regenrates the sdf files but also repopulates all the old Id mapping data.

    Hope this helps!

    Thanks,

    Mithuna



    Monday, April 30, 2012 8:36 PM