Skip to main content
March 9, 2021
Question

Appian RPA Outlook Error

  • March 9, 2021
  • 6 replies
  • 0 views

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: RetentionPolicyName
Source: Microsoft Outlook
Description: The operation failed.

Has anyone faced similar scenario . Please guide me if you had overcome this scenario.

Thanks

6 replies

March 15, 2021

Hi, i have the same error, have you solved yet?

I think it's maybe because i have no retention policies defined

March 16, 2021

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);
carlosm0009
April 26, 2021

I had the same error reading mails from a folder, did u solved that?

April 27, 2021

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

carlosm0009
April 27, 2021

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: RetentionPolicyName
Source: Microsoft Outlook
Description: 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 folderList = outlook.getOlFolderManager().getAllMailFoldersList();
		for (IOlFolder iOlFolder : folderList) {
			if (iOlFolder.getFolderPath().equals(pathToMails)) {
				outlook.getOlFolderManager().getMailList(iOlFolder.getEntryID());
				break;
			}
		}
	}

May 31, 2022

[mention:87befa47e6bf4eb484fb7a8b1be00270:e9ed411860ed4f2ba0265705b8793d05]  - 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.