Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Dynamics Portal - Retrieve Plugin Limitations for Annotation

(0) ShareShare
ReportReport
Posted on by 12

Hello Everyone,

I have run into a little bit of trouble with Dynamics Portals inside Dynamics Online and I am looking for some help or feedback with it. I have four custom developed Plugins for Notes (annotation):

- PreAnnotationRetrieve & PostAnnotationRetrieve
- PreAnnotationRetrieveMultiple & PostAnnotationRetrieveMultiple

* These are all PreOperation and PostOperation plugins

From the Dynamics CRM Customer Service Module, both RetrieveMultiple and Retrieve runs properly, without any issues. However, when I attempt to load Notes from the Dynamics Portal (notes with attachments for cases), only RetrieveMultiple fires, but not Retrieve.

Q: Since Dynamics Portal actively uses annotations to store CSS, JS and other web resource files, my question is: is this behavior intentional and I should not be using Retrieve plugins for annotations on the Dynamics Portal side, or this is some sort of bug?

Thank you in advance!

Best Regards,
Gabor

*This post is locked for comments

  • Gaborg Profile Picture
    Gaborg 12 on at
    RE: Dynamics Portal - Retrieve Plugin Limitations for Annotation

    Hi Nicholas,

    You were right, Dynamics Portal uses RetrieveMultiple to retrieve the Annotations with their content. After that, the content gets cached so the Retrieve plugin does not fire because the content is already there and it is presented from the cache. I will make the necessary changes in my code to make this work.

    Thank you for your help and for your time, I am glad that you could point me in the right direction so fast!

    Gabor

  • Verified answer
    Nicholas Hayduk Profile Picture
    Nicholas Hayduk 2,863 on at
    RE: Dynamics Portal - Retrieve Plugin Limitations for Annotation

    Hi Gabor,

    The Portal code uses the standard SDK to access everything, including Annotations - it has no direct access to the database.  There is no way for it to bypass the pipeline that plugins tie into.

    My guess is that the original request for the annotations is being cached, and then when it goes to download the file, it already has the contents of the file in cache from the RetrieveMultiple request, and therefore you don't see another plugin fire.

    Try making your modification in the RetrieveMultiple - I wouldn't be surprised at all to see that work.

    Nick

  • Gaborg Profile Picture
    Gaborg 12 on at
    RE: Dynamics Portal - Retrieve Plugin Limitations for Annotation

    Hi Nicholas,

    Thank you for your response!

    We are using the Customer Self-Service portal, where our customers are able to open cases and create notes with attachments - this is default functionality. Lets assume that we create a new case and create two notes for that case, both with an attachment. When we open the page of the case on portal, RetrieveMultiple fires for Annotations (just like it would in Dynamics CRM). However, when I click on one of the attachments to download it, none of the plugins fire (while it would fire Retrieve for Annotations in Dynamics CRM).

    My goal would be to change the body content of the annotation before the download starts, without changing the entity in the database (so basicly the plugin would modify the response before sending it to the client). When we download an annotation, a new popup window opens up with a custom URL, so my concern is it skips all plugin executions and attempts to download the attachment directly from the database. Because of this, I don't think modifying the response in RetrieveMultiple would affect the download at all but I might give it a try and see what happens!

    I have done some research and found that Retrieve plugin properly fires for other entity types.

    Gabor

  • Suggested answer
    Nicholas Hayduk Profile Picture
    Nicholas Hayduk 2,863 on at
    RE: Dynamics Portal - Retrieve Plugin Limitations for Annotation

    Hi Gabor,

    This is just a guess, because I haven't been through all of the code, but it is possible that every time the portal code queries for annotations, even when getting a single record, it uses a RetrieveMultiple.  This wouldn't surprise me at all because the code uses LINQ-to-CRM, which uses RetrieveMultiple for the queries, even if you're querying based on the ID of a record.

    Hope that helps.

    Nick

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans