Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Suggested answer

Is there a way to replace attachments with links to third party systems in Dynamics CRM?

Posted on by 5

Hey Community,

I want to replace attachments from annotation entities with a link to a third-party system. The background is that we have developed a solution which automatically exports attached documents to our document management system (DMS). Since storage space in Dynamics CRM is a little pricy and we do not want redundant document storage (CRM and DMS), the idea is to remove the exported documents from CRM and replace them with a reference link to the document inside our DMS.

I want to replace the attachment from inside a plugin and already have tried out some ideas, which include creating a .url file containing the URL to the exported document and replacing the original document with said file. That is also the closest I got to functioning, but I want to achieve a similar behaviour to what CRM is doing by default, which is downloading the attachment when a user clicks on it.

For the past two days, I have been searching the community and other sources but could not find anything that could help me achieve this goal. The closest thing I found was blog posts describing how to delete an attachment from inside a plugin, which only partially fits my scenario.

Is what I am trying to accomplish even possible?

Thanks for any help!

  • Suggested answer
    Ray Profile Picture
    Ray 1,477 on at
    RE: Is there a way to replace attachments with links to third party systems in Dynamics CRM?

    Hi Timon Wansing,

    I have done this before.

    My poor solution is below:

    Plugins:

    1. Post Create ---- this plugin  moves the attachment to target system and then update the annotation's content to null.
    2. Post Delete ---- this plugin delete the attachment from target system.
    3. Post Retrieve  ---- this plugin get the content from target system when annotation get retreived.
    4. Post RetrieveMultiple ---- this plugin get the content from target system when annotation get retreived.

    WebResource:

    1. HTML page to show attachment list and preview.(This should be replaced by a PCF control.)

    My solution works but still with many problems:

    1. Plugin may get timeout because it need time to transfer/get attachment content.
    2. RetrieveMultiple plugin may slow down the page loading if any subgrid or timeline content annotation with attachments.

    My solution is an one-way soluton, and I think you may need a two-way solution so that the attachment can sync between CRM and DMS? Then you may need to create extra Custom APIs for it.

  • T.Wansing Profile Picture
    T.Wansing 5 on at
    RE: Is there a way to replace attachments with links to third party systems in Dynamics CRM?

    Hey Guido,

    I have not yet looked into PCF controls, but I will do now. Thank you for the hint!

  • T.Wansing Profile Picture
    T.Wansing 5 on at
    RE: Is there a way to replace attachments with links to third party systems in Dynamics CRM?

    Hey Ana,

    Thanks for the reply!

    I have seen this solution, but since we are currently building our own, it would mean we have to be dependent on another solution to get this feature, which we do not want. As far as I know, this solution does also not support our DMS so completely switching is also not an option.

  • Guido Preite Profile Picture
    Guido Preite 54,063 Moderator on at
    RE: Is there a way to replace attachments with links to third party systems in Dynamics CRM?

    you probably can solve it with a PCF control

  • ananeto Profile Picture
    ananeto 144 on at
    RE: Is there a way to replace attachments with links to third party systems in Dynamics CRM?

    Hey!

    If you eventually decide to go for a pre-built solution for this, I would recommend CB Dynamics 365 Seamless Attachment Extractor which does exactly what you are trying to achieve.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,532 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,501 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans