Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Suggested answer

ms crm plugin question

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.

Categories:
  • 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,962 Moderator 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,582 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

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…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 228,683 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans