synchronize with outlook report

BeliasBelias Member Posts: 2,998
We are having some problems with Synchronize with Outlook process for a customer that has:

We are having some problems with Synchronize with Outlook process for a customer that has:
• Navision 4 SP3 (sql)
• Microsoft Outlook 2003 SP3

Some notes regarding the synchronization process:
• It is working from 2007-2008 but only recently we’re having some problems
• We have done some customizations but they’re not so heavy to create such problems
• We have tried to register the latest version of NSAppHandler (version 4.0.3.24734), but without positive results, so we replaced it with the older version (4.0.3.23305)
• We tried to delete the record from the Synchronization Entries table and the respective records from Outlook (only those records that refers to salespersons) and then for the first run the problem has been solved. But we would try to find the problem avoiding the manual deletion.

The problem seems to be in the first dataitem, where the system analyzes the Synchronization Entries table, first with contacts-type and then salesperson-type.
We have two different cases that gives the same error:
1. The entries have been processed (some updated and some others not) in the first dataitem, but in the next one we receive the error message “This Automation variable has not been instantiated”
ImportContacts - OnPreDataItem()
IF NOT OLAppMgmt.GetApplication(OLApplication) THEN BEGIN
  OutlookIntegrationLog.GeneralError(OLAppMgmt.NoOutlook);
  CurrReport.SKIP;
END;
OLContacts := OLApplication.OContacts;
IF ISCLEAR(OLContacts) THEN                               // at this point the system makes the skip 
  CurrReport.SKIP;

//OLContacts := OLContacts.Restrict('[Sensitivity] <> 2');
IF ISCLEAR(OLContacts) THEN
  CurrReport.SKIP;

Window.UPDATE(1,'2');
Window.UPDATE(2,Text004);
NoOfRecords := OLContacts.Count;

ImportContacts - OnAfterGetRecord()
FOR i := 1 TO NoOfRecords DO BEGIN
  OLContact := OLContacts.Item(i);                       //here there is the error

I have some doubts about the CurrRepot.SKIP in OnPreDataItem (it should be a BREAK in my opinion, otherwise the dataitem will be processed anyway :-k ), but is it correct that the system skips this dataitem? in other words, should the process skip all the contacts?

2. The records in the Synchronization Entries table are processed but in this point the system cannot read the Outlook contact (that exists!) and skips the record.
Synchronization Entry - OnAfterGetRecord()
      IF OLItemID.GetBSTRLength > 0 THEN
        OLItemExists := OLContactHandler.RetrieveContact(OLItemID,OLContact)
      ELSE
        OLItemExists := FALSE;

The variable OLItemExists is false after having processed 2 contacts and then the process gives the same error message in the same point described above.
Have anyone already encountered this problem?

Thanks in advance.
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Sign In or Register to comment.