Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

CRM Business Rule

Posted on by Microsoft Employee

I am trying to set a business rule that auto populate a option set field in CRM. The business rule is to set the option set field as the relevant quarter based on the date in a separate field.

So for example if the Handover date is between 01/01/2019-31/03/2019 then this would set as Q2 in my option set field (the line of work i am in means are quarters stared in October 2018 and wont finish until March 2022 so I will have 14 quaters).

I seem to have an issue with it setting the correct quarter when the handover date is the 1st of April, July, October for all years. The 1st January however does select the correct quarter in all years?

I have tried setting my condition to be equal to or greater than/equal to or less than (eg. equal to or greater than 01/04/2019 and equal to or less than 30/06/2019) and also greater than/less than (eg. greater than 31/03/2019 and less than 01/07/2019) but neither way works.

It is only an issue with the 1st if the month, if the handover date is 2nd of the month then the business rule works. I cant get my head around the logic. 

Any help on this would be appreciated

*This post is locked for comments

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: CRM Business Rule

    Hi ,

    Here I have created similar requirement and its working for me  , Hope this helps you to implement - 

    Here is my BU -

    IFHandoverDate greater than or equal "10/1/2018, 12:00:00 AM" AND HandoverDate less than or equal"12/31/2018, 12:00:00 AM"

    THEN
    Set Quarter to "Q1"
    ELSE IF

    HandoverDate greater than or equal "1/1/2019, 12:00:00 AM" AND HandoverDate less than or equal"3/31/2019, 12:00:00 AM"

    THEN
    Set Quarter to "q2"
    ELSE IF

    HandoverDate greater than or equal "4/1/2019, 12:00:00 AM" AND HandoverDate less than or equal"6/30/2019, 12:00:00 AM"

    THEN
    Set Quarter to "Q3"
     
     
    2019_2D00_01_2D00_08_5F00_12_2D00_02_2D00_47_5F00_rslt.png
    2019_2D00_01_2D00_08_5F00_12_2D00_06_2D00_07_5F00_BU2.png
     
    I did the handover date field TimeZone independent.
     
     
    2019_2D00_01_2D00_08_5F00_12_2D00_01_2D00_49_5F00_Fld.png
    See here it is working fine -
     
     
    2019_2D00_01_2D00_08_5F00_12_2D00_02_2D00_47_5F00_rslt.png
     
     
     
  • gdas Profile Picture
    gdas 50,085 on at
    RE: CRM Business Rule

    Hi ,

    Can you please share  BR  condition expression.

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: CRM Business Rule

    Hi,

    Is the scope of the BR is Entity level? Do you think it could be related to timezone conversion thing?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: CRM Business Rule

    Hi Sreevalli,

    I am not really knowledgeable with java script. The business rule works but just not on a specific date which appears to be the 1st of certain months. Is this not something that can be overcome within the business rule.

  • Suggested answer
    Sreevalli Profile Picture
    Sreevalli 3,256 on at
    RE: CRM Business Rule

    Hi James,

    It would be easy to manage with Javascript than Business rule. help logic - stackoverflow.com/.../get-current-quarter-in-year-with-javascript

    Since you are only populating it from backend/Js recommend to use String field instead Optionsets.

    Every Simple logic change need loot of effort(BR, Optionset etc.)

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