web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

I want to count records under a specific condition and store that value into a field

(0) ShareShare
ReportReport
Posted on by

Hello everyone!

I have a Transfer entity which has a field Type , between Transfer and Maintenance.

I want to count only those records that are of type Maintenance and store it to a field such as Times of Maintenance.

I tried with Rollup but it doesn't work since it only counts records of that entity. I thought about workflow but i need to initiate the field to have value of 0 the first time and then to increment it . How do i put value 0 for the first time?

Any ideas?

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    You can do it using workflow by and on create of record set value to 0.

  • Verified answer
    Georgy Profile Picture
    on at

    You can configure filtering in Rollup field so that it would only count particular entities.

    if not I would recommend to write you a plugin with fetchxml aggregations rather than doing it through workflow.

  • Community Member Profile Picture
    on at

    I have two entities which are related , Items and Transfers

    What if i want to count the transfers for each item.

    What format should my xml be?

  • Suggested answer
    Shidin Haridas Profile Picture
    3,497 on at

    Hi Shak,

    The field in question 'Times of Maintenance', is the field on the Transfer entity as well?

    You will not be able to use the rollup feature if that is the case.

    Instead of using a workflow, you can have a plugin registered on Create / Update (Filtering attr: Type), which does the processing and updates the record accordingly.

    That being said, please do re-consider if you need to store calculated values in the DB rather than recalculating them dynamically, when required.

  • Suggested answer
    Community Member Profile Picture
    on at

    Refer this:

    community.dynamics.com/.../147466

  • Verified answer
    ansrikanth Profile Picture
    3,115 on at

    If you just want to count all transfers for an Item, Just use rollup field - that is the purpose of rollup fields. If you want to count Maintenance type differently and Transfers differently then you can use Filter option in rollup fields.

  • Community Member Profile Picture
    on at

    It worked thanks a lot ! I somehow missed the filtering in the Rollup field when i tried it before

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans