Error -Specified Cast Not Valid while Retrieving mails - Outlook VBO
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-05-19 07:00 AM
Hello Team,
I am facing an issue with Outlook VBO internal Business object - Basic Get Mails action. I am trying to read all emails from Inbox both Unread & Unread emails. Once in every 10 runs , we get an error "Specified Cast not Valid". After attempting run mutiple times on the same set of mails, it works. I have checked event logs but it does not show anything unusual.
Any idea what is causing this issue ? Any help in this regard is much appreciated.
Â
Â
Â
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-05-19 02:45 PM
Maybe temporarily enable logging in the VBo to see where the failure point is?
Or could it be 1 mail in particular that is causing the issue? In the VBO on the 'Internal_Get Items' page you'll see the code stage that retrieves mail. In it you'll see a series of lines where it populates a row in the datatable (collection) output, eg row("Subject") = item.Subject
I'm wondering if the cast error comes from one of these lines? And maybe by commenting out these lines one at a time and re-running the test, you'll locate the problem?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-05-19 10:19 AM
Hi John,
Â
Thanks for the response . I did go through the code stage and removed unwanted attributes of the item .as i initally felt the same .For eg: attachment etc . However  I was bit confused since if i try mutliple times , it works for the same set of mails.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
13-05-19 02:34 PM
Hmm strange. If it can work sometimes and sometimes not, could it be that Outlook is 'doing something' at the time of the exception? Not sure what to suggest to be honest, other than to keep experimenting to bear down on the problem.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-04-24 12:28 PM
Hi, I just had the same situation and it turned out that it has been caused by some recalled messaged in an inbox. Once I removed this recalled message (as it's not really a message but some other type of Outlook item), the 'List Emails' action started working again.
