Hi Everyone,
I am trying to automate outlook application. But I am getting the below error continuously.
Caused by: com.novayre.jidoka.outlook.api.exception.JidokaMsOutlookException: Invoke of: RetentionPolicyNameSource: Microsoft OutlookDescription: The operation failed.
Has anyone faced similar scenario . Please guide me if you had overcome this scenario.
Thanks
Discussion posts and replies are publicly visible
Hi, i have the same error, have you solved yet?
I think it's maybe because i have no retention policies defined
I have a workaround, in case you don't have to attach files:
- Instead of doing this (according to documentation):
IOlMailItem newMail = new OlMailItem(); newMail.setSubject("Subject for IJidokaOutlook mail"); newMail.setTo("toAccount@myCompany.com"); newMail.setCc("ccAccount@myCompany.com"); newMail.setBody("Body for IJidokaOutlook mail"); IOlMailItem createdMail = outlook.getOlMailManager().createMail(newMail, true); outlook.getOlMailManager().addAttachmets(createdMail, "C:\\temp\\attachment.pdf"); outlook.getOlMailManager().sendMail(createdMail);- You do this (send your newMail without creating):
IOlMailItem newMail = new OlMailItem(); newMail.setSubject("Subject for IJidokaOutlook mail"); newMail.setTo("toAccount@myCompany.com"); newMail.setCc("ccAccount@myCompany.com"); newMail.setBody("Body for IJidokaOutlook mail"); outlook.getOlMailManager().sendMail(newMail);
I had the same error reading mails from a folder, did u solved that?
Hi Carlos, I tried to close the outlook application and run the bot, the issue got resolved. Please post the execution logs so that i can help you. thanks
Hello, didn't work in my case.
The exception is thrown when I'm trying to access to a mail inside a folder.
This is the error that is shown in the log[ERROR] 2021-04-27 06:24:16 05s (0h) - com.novayre.jidoka.outlook.api.exception.JidokaMsOutlookException: Invoke of: RetentionPolicyNameSource: Microsoft OutlookDescription: The operation failed. at com.novayre.jidoka.outlook.impl.util.JacobUtils.invokev(JacobUtils.java:418) at com.novayre.jidoka.outlook.impl.util.JacobUtils.getProperty(JacobUtils.java:342) at com.novayre.jidoka.outlook.impl.model.BaseObject.getProperty(BaseObject.java:52) at com.novayre.jidoka.outlook.impl.model.BaseObject.getPropertyAsString(BaseObject.java:124) at com.novayre.jidoka.outlook.impl.model.MailItem.getRetentionPolicyName(MailItem.java:927) at com.novayre.jidoka.outlook.impl.manager.MailManager.transformToOlMailItem(MailManager.java:470) at com.novayre.jidoka.outlook.impl.manager.OlFolderManager.lambda$getMailList$1(OlFolderManager.java:163) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.collect(Unknown Source) at com.novayre.jidoka.outlook.impl.manager.OlFolderManager.getMailList(OlFolderManager.java:165)
And this is the code to open the folders and read the mail.
private void initOutlook() { server.info("Show Folders:"); IOlFolderFW criteria = new OlFolderFW(); IOlMailItemFW criteriaMail = new OlMailItemFW(); criteria.setFolderPath(pathToMails); criteriaMail.setSubject("TEST"); List<IOlFolder> folderList = outlook.getOlFolderManager().getAllMailFoldersList(); for (IOlFolder iOlFolder : folderList) { if (iOlFolder.getFolderPath().equals(pathToMails)) { outlook.getOlFolderManager().getMailList(iOlFolder.getEntryID()); break; } } }
jacinths0002 - Hello There, Can you please elucidate me on the detailed step of how to include those jars and dependencies for outlook module please ? Either through workflow module or code library is fine.