How do I modify a custom field in Outlook from Navision

navman001
Member Posts: 15
Hi, need help with this one! 
In Navision 4.00 I create a To-Do as type = Meeting, synch with outlook to create a new appointment, all standard stuff so far, the problem arises with custom fields that I have added to the appointment form in Outlook ie/Navision ID, Navision Description.
How can I search the appointments to find the one just created and then populate the custom fields with fields out of a Navision table, I've tried the following but with no success:
VARIABLES:-
Name DataType Subtype Length
olApp Automation'Microsoft Outlook 11.0 Object Library'.Application
olNS Automation'Microsoft Outlook 11.0 Object Library'.NameSpace
olItem Automation 'Microsoft Outlook 11.0 Object Library'.AppointmentItem
olItems Automation'Microsoft Outlook 11.0 Object Library'.Items
olCFolder Automation'Microsoft Outlook 11.0 Object Library'.MAPIFolder
Prop Automation'Microsoft Outlook 11.0 Object Library'.UserProperty
S Char
Props Automation 'Microsoft Outlook 11.0 Object Library'.UserProperties
//Code
S := 39;
CREATE(olApp,FALSE);
olNS := olApp.GetNamespace('MAPI');
olCFolder := olNS.GetDefaultFolder(9);
olItems := olCFolder.Items;
//line below for testing purposes as my custom field has a value of 1
olItem := olItems.Find(STRSUBSTNO('[Navision ID] = %1%2%1',S,1));
Props := olItem.UserProperties; //DEBUGGER ERRORS HERE
Prop := Props.Item(('Navision ID'));
Prop.Value := 12345;
olItem.Save;
The error I receive is 'This automation variable has not been instantiated'.
Any help is much appreciated.

In Navision 4.00 I create a To-Do as type = Meeting, synch with outlook to create a new appointment, all standard stuff so far, the problem arises with custom fields that I have added to the appointment form in Outlook ie/Navision ID, Navision Description.
How can I search the appointments to find the one just created and then populate the custom fields with fields out of a Navision table, I've tried the following but with no success:
VARIABLES:-
Name DataType Subtype Length
olApp Automation'Microsoft Outlook 11.0 Object Library'.Application
olNS Automation'Microsoft Outlook 11.0 Object Library'.NameSpace
olItem Automation 'Microsoft Outlook 11.0 Object Library'.AppointmentItem
olItems Automation'Microsoft Outlook 11.0 Object Library'.Items
olCFolder Automation'Microsoft Outlook 11.0 Object Library'.MAPIFolder
Prop Automation'Microsoft Outlook 11.0 Object Library'.UserProperty
S Char
Props Automation 'Microsoft Outlook 11.0 Object Library'.UserProperties
//Code
S := 39;
CREATE(olApp,FALSE);
olNS := olApp.GetNamespace('MAPI');
olCFolder := olNS.GetDefaultFolder(9);
olItems := olCFolder.Items;
//line below for testing purposes as my custom field has a value of 1
olItem := olItems.Find(STRSUBSTNO('[Navision ID] = %1%2%1',S,1));
Props := olItem.UserProperties; //DEBUGGER ERRORS HERE
Prop := Props.Item(('Navision ID'));
Prop.Value := 12345;
olItem.Save;
The error I receive is 'This automation variable has not been instantiated'.
Any help is much appreciated.
0
Comments
-
1) On which statement, Navision gives the error?
2) try also CREATE(olApp,TRUE);Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Hi Alain,
Props := olItem.UserProperties; //DEBUGGER ERRORS HERE
-Navman0010 -
The error is caused by the FIND statement not returning an appointment item. There's still a long way to go before I have this functioning as I would like.
-Navman0010 -
navman001 wrote:The error is caused by the FIND statement not returning an appointment item. There's still a long way to go before I have this functioning as I would like.
-Navman001
Check the Microsoft objects library for more info.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions