SBX - Search With Button

SBX - Forum Post Title

what, why, where and how should we use the plugin message 'Retrieve' and 'RetrieveMultiple' message while registering a plugin step in plugin Registration tool.

Microsoft Dynamics CRM Forum

  • Amit Kumar Rath posted on 13 Oct 2018 5:06 AM
    My Badges


    1) what, why, where and how should we use the plugin message 'Retrieve' and 'RetrieveMultiple' message while registering a plugin step in plugin Registration tool.

    2) What is the actual role of outputparameter and BusinessEntity in the plugin code when we use these messages.

    3)How these messages impacts the performamnce of CRM?

  • Abed Haniyah responded on 13 Oct 2018 9:28 AM
    My Badges


    have a look to this article: Difference between Retrieve and Retrieve Multiple

  • Hi Amit ,

    Retrieve and retrieve multiple message  giving you the definitions from name itself. The main difference is that when do you want to execute your plugins whether it's for retrieve single record retrieve using GUID or using query expression or fetch XML. Let say you are opening an entity form in that case plugin register with retrieve message will be execute.

    Now let say you are navigating entity list page in that case plugin register with retrieve multiple message will be execute.

    In an real life example from my experience I was registered a plugin with retrieve multiple message in a custom entity called Billing Account .Those billing accounts are basically coming from different integrated system using WCF service at real time.The WCF service is calling inside plugin to get the customer billing account data and In the plugin we basically create/update customer billing account getting from integrated system.Each customer can have multiple billing accont so we have added one subgrid in customer forms. Now when user will navigate to customer form subgrid will load internally plugin got fired , as plugin register in retrieve multiple message and retrieve  real time billing account data from Billing Account entity.

    Similar things you can do it for single record also.

    You should avoid those message and use those messages when you dont have any other options .And if you use those messages in the plugin make sure you are handling the proper validation with introducing additional field to validate when your plugin logic will execute. It's always good practice to register plugin with retrieve message and that's why MS having two messages due to performance.

    I would encourage to raise question number 2 in another thread to make thread clean and with  same subject related discussions.

  • Aric Levin responded on 13 Oct 2018 11:28 PM

    Hi Amit,

    Just to add to the above responses, which basically cover your question.

    In a few projects (not too many though), I had to use RetrieveMultiple to manipulate the data that is being displayed to the user.

    An example would be if you are displaying a field (such as Tax Id number), and you are not using Secured Fields, and want to display only the last four digits, you could manipulate the RetrieveMultiple results to change the values of the query that are returned to the user.

    Hope this helps.

  • Dynamics365 Rocker responded on 15 Oct 2018 3:11 AM
    My Badges

    Retrieve and retrieve multiple will be use when we want to execute plugin on an entity view.

    For output parameter, Please go to below link:


SBX - Two Col Forum

SBX - Migrated JS