NS App Handler Automation Error

thaug
Member Posts: 106
I have some code that scans through the e-mail inbox to gather the subject lines to compare them with a logging solution, and this had been working well for some time using the MAPI integration. I've been trying to upgrade it to use the NS App handler, and it mostly works, but I'm having a problem as it is scanning through the inbox. When it gets to certain messages in the inbox, which typically has over 100 items in it, it stops and throws up the famous:
This message is for C/AL programmers:
This Automation variable has not been instantiated.
You can instantiate it by either creating or assigning it.
What is odd is that it is collecting this data with no problem for over 80 of the items, and it is stopping at a particular e-mail. However, this e-mail changes all the time, as the inbox is constantly being updated with new items, so the problem doesn't lie within the e-mail subject. The following is the simple code that generates this error every single time:
I'm running Nav 4.0 SP3 SQL and Outlook 2003.
This message is for C/AL programmers:
This Automation variable has not been instantiated.
You can instantiate it by either creating or assigning it.
What is odd is that it is collecting this data with no problem for over 80 of the items, and it is stopping at a particular e-mail. However, this e-mail changes all the time, as the inbox is constantly being updated with new items, so the problem doesn't lie within the e-mail subject. The following is the simple code that generates this error every single time:
Name DataType Subtype Length OInbox Automation 'NS Outlook Synchronization Handler'.OInboxItems OInboxItem Automation 'NS Outlook Synchronization Handler'.OInboxItem OApp Automation 'NS Outlook Synchronization Handler'.OApplication CLEAR(OApp); CREATE(OApp); OApp.Logon; OInbox := OApp.OInboxItems; OInboxItem := OInbox.Item(85); MESSAGE(OInboxItem.Subject);
I'm running Nav 4.0 SP3 SQL and Outlook 2003.
There is no data, only bool!
0
Comments
-
OK, I seem to have found out what is causing the problem, now I only need to find out a way around it. I'm thinking I'm going to need to revert to MAPI automation, but I wanted to avoid that given the problems with using MAPI with various versions of Outlook.
When the routine tries to access the subject lines of those messages it is tripping up on, these messages are NDR reports, and Outlook/Exchange treat these differently from other messages. So it looks as the NS App Handler only deals with bonafide messages, and not these pseudo-messages.
Anyone have a workaround to suggest?There is no data, only bool!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