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)

Workflow to check number records by user and date range?

(0) ShareShare
ReportReport
Posted on by 25

Good afternoon everyone

We need to be able to have a notification sent out when any user reaches a count of x number of records created in last y days.  I've got a workflow that creates records in a custom entity, which is simply Createdon and User, but each time need to say CHECK if count of records for this user where date is in last 30 days, send email to someone. 

I just can't work it out.

If anyone out there can point me in the right direction it would be much appreciated.  Even if the direction is 'give up now'.

Many thanks

Jules

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    Hi,

    I am not sure if Ultimate Workflow Toolkit (Andrew Butenko) or Dynamics 365 Workflow Tools (Demian Rasko) has a Fetch option to it, but I would say that you have a couple of options if none of those work:

    1. On the Create of a new record of your entity run a workflow and get the User from it. Get the total number of records for that user within your timeframe (either Custom workflow or via Workflow Tools). Based on that count send an email.

    2. Same as option 1, but using a Plugin on the Create method.

    3. Writing a Flow on the Create of a new record. It would require you to do some research on this one if you are not familiar with flows.

    Hope this helps.

  • Suggested answer
    Kokulan Profile Picture
    18,054 on at

    You could think about creating a rollup-field on the user entity and have this workflow that riggers On Create of the custom entity to do a Force Calculation of the Rollup-field (You can use the Workflow Tools Force Calculate Rollup Field CWA for this.). After the rollup-field value is updated, in the workflow check if the total is greater than or equal to X, then send an email

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi,

    I think if you are developer then best way is to create simple plugin where you can fetch the entity record with condition created on = last x days and owner  = calling user id . If record count equals X then create email activity.

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi Julia,

    You can use Workflow Elements to do a count within you workflow. Use Get Query-

    kaskelasolutions.com/current-query-get-results

    Hope this helps.

  • Suggested answer
    Sreevalli Profile Picture
    3,256 on at

    Hi Julia,

    As Kokulan Suggested, Rollup fields would be best option. we donot need to trigger plugin on create of each record but we can trigger workflow on update of rollup field and check if the number equal to 'X' then send out email. last Y days calculation can be handled in rollup calculations setup.

    community.dynamics.com/.../dynamics-365-rollup-fields-important-points

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