The constraints for this requirement are as follows:
.msg
format). So, for instance, simply dumping the email body as a file, and the associated attachments as other files, grouped together in a folder somewhere is good enough;I am aware of the fact that one can use Dynamics Advanced Find to export email data (even the body of the email sans attachments) into an Excel file. We do need the email attachments, however.
What is a good way of implementing the above solution?
Hello,
We had the same requirement, Every year the Organization hire seasoned professionals, This is state agency so the positions are public. So there is a Website from where interested professionals can send application along with PDF or DOC format resume (resume is mandatory), these requests comes into CRM directly (means creates a record in entity and attachments are stored in Notes of that record, and everytime an attchment is created we add Subject name "Resume Attached from Webportal" and then Internal Office Admins qualifies for next steps. So, every year those data has to be pruged from CRM system and has to be retruned to library for archives.
So i ended up creating a Dynamics CRM Attachment Extractor - Utility for this task.
I decided to build an utility (console application) and exe can be distributed or made available to run. User may double click the exe and application will download the file in the specified path.
Console application is calling Org service as per the App Settings (CRM Org defined here). It establishes the connection first and then displays the message to use on successful connection and advises user to wait because downloading can take while. FetchXML is querying annotation entity and filtering on filename that contains .pdf,.doc,.docx. Limited querying filters can be added too.
Application uses C:\AttachmentsForSeasonalJobs location to store the files, if folder does not exist, user have to create one. After download completes, app displays the “Download complete” message and user can press any key to get out of the command prompt.
Also, While downlaod I have prefixed the annotationID (GUID) to each attachment name, in case any attachment needs to be traced back. File name is made of annotationID + _ + filename.
By default an organization service can return only the first five thousand records and page details for the next set of records, if exists. The result entity collection exposes a Boolean attribute called MoreRecords, it will be true if more records available else false. If more records available then you need to use the combo of pagingcookie and page(pagenumber) to retrieve rest of the records.
Thanks.
Hi Merowig,
You can extract email attachments by reading data from the activitymimeattachment entity and writing the file content to the local file system. This article explains a method for this.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156