Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to create a field that counts a property where the date is in this fiscal period

Posted on by Microsoft Employee

Hi

Wondering if anyone can help me to create a field in Contacts form that will look at a date field in property form and count it if the date is in this fiscal period?

I have tried looking at calculated and rollup fields but neither have the option for "This fiscal Year". I don't want to hard code dates into a field and have to change it every year.

Do I need to create a workflow to update this field?

Any help would be greatly appreciated.

Thanks

*This post is locked for comments

  • Verified answer
    Aiden Kaskela Profile Picture
    Aiden Kaskela 19,692 on at
    RE: How to create a field that counts a property where the date is in this fiscal period

    Hi Colin,

    I've made the updates to Workflow Elements and I think you'll be able to do what you need now in workflows. There will still be a little manual intervention periodically though, because of the nature of the requirement. Download Workflow Elements at kaskela.wordpress.com and you'd set up your workflow like this (assuming your FY is 1/1 to 12/31 inclusive):

    - Workflow will be run on contact, and it can be run on demand or change of your field (I'll say "Last Purchase" for ease).

    - Add a Date field to the contact "Last Purchase Evaluation"

    - Add a boolean field to the contact "Last Purchase in FY"

    The workflow will have these steps:

    1 - Call activity "Date – Get Date Components", and pass in the Process Execution Time (the time when the workflow runs). You'll get back all the date components as individual parts.

    2 - Call activity "Date – Build Date From Parts", and pass in 1/January for the month, 1 for the Day and (Step 1 - Year) as the Year. The resulting Date will be the beginning of the current fiscal year. (This was the activity I built today).

    3 - Call activity "Date – Build Date From Parts", and pass in 12/December for the month, 31 for the Day and (Step 1 - Year) as the Year, 23 hours and 59 minutes. The resulting Date will be the end of the current fiscal year.

    4 - Check condition - if "Last Purchase" is on or after (Step 2 Date) and it's on or before (Step 3 Date), it's in the Fiscal Year. Update the contact and set "Last Purchase Evaluation" to Process Execution and "Last Purchase in FY" to Yes.

    5 - If not (step 4), set "Last Purchase Evaluation" to Process Execution and "Last Purchase in FY" to No.

    With this setup, any time that "Last Purchase" changes, you'll reevaluate if it's in the current FY.

    The only problem with this scenario is that somebody could make a purchase on 12/30 in the current FY so it's set to Yes, and two days later it should be set to No. Using a workflow, there's no way to automatically re-evaluate it when it's stale. The solution to this is to use the "Last Purchase Evaluation" field. When a new FY comes around, you'll need to reset it. So on 1/1 (ish), you'd do an Advanced Find for contacts where the "Last Purchase Evaluation" was earlier than the FY, and the "Last Purchase" was before the FY, and bulk edit them to set Last Eval = Today and Last Purchase = No. You could also run the workflow on contacts where the last eval was prior to the FY begin - that'll be safer because the logic is built in to the workflow, but it'll take a lot more time because you'll have to kick it off on a batch of records and sit and wait for them all to finish.

    Anyway, this should meet your needs.

    Hope this helps! I'd really appreciate if you'd mark these answers as Answering your question.

    Thanks,

     Aiden

  • Suggested answer
    Aiden Kaskela Profile Picture
    Aiden Kaskela 19,692 on at
    RE: How to create a field that counts a property where the date is in this fiscal period

    Hi Colin,

    I don't think there's an easy way to do this out of the box, but I have an add-on that /almost/ lets you do this (Workflow Elements at https://kaskela.wordpress.com) . I'm going to make a few updates to it that'll let you accomplish what you're looking for. I'll give you an update later on today.

    Thanks,

     Aiden

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

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans