Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

ms crm plugin question

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Entity A has whole number field called wholenumber. Entity A also have subgrid. when the new record is created in the subgrid it should fetch the count from subgrid and update it to the wholenumber field. using plugin.

  • Mohsin Ali Profile Picture
    Mohsin Ali 3,610 on at
    RE: ms crm plugin question

    There are two ways you can use it.

    1. Add a rollup field into 'Entity A' to replace the whole number field.

    2. To achieve it through the plugin, at post-operation of CREATE message of that subgrid record register the plugin. Count all records and then update the whole number field with a total number of associated records from subgrid.

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: ms crm plugin question

    Hi,

    Register your plugin on Post create of Subgrid entity -

    First retrieve Entity A guid from Target context and then use below.

    Now in you plugin logic, you will use fetchxml to find count of the records and then update the count in Entity A.

    Subgrid entity will have Entity A lookup.

    What if Record is getting deleted from subgrid, do you want to again update the count?

    If yes then you may have to write code to do that

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: ms crm plugin question

    without using rollup field .can u suggest me using plugin?

  • Suggested answer
    Vipin J Profile Picture
    Vipin J 1,583 on at

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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans