MAPI CreateFolder function does not return correct values for "PR_RETENTION_FLAG" and "PR_RETENTION_PERIOD" tags

TestEx 0 Reputation points
2023-02-23T12:09:53.5633333+00:00

Hi,

I am trying to open an existing subfolder (where retention policies are set) under "Inbox", using the MAPI Createfolder() for copying email messages in Exchange Online. While querying the folder object returned, value for tags like "retention flag" and "retention period" (this happens sometimes) are not returned correctly.

Once the message is copied to the subfolder, the value for retention flag gets reset to 128 (Use parent folder policy) and the retention period tag is removed. So, if the retention policy on the specific folder is set to "1 week delete" etc., it is reset back to "Use parent folder policy".

Can someone please suggest.

Thanks.

Outlook
Outlook
A family of Microsoft email and calendar products.
4,005 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,986 questions
Exchange Server Development
Exchange Server Development
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Development: The process of researching, productizing, and refining new or existing technologies.
547 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.