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
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"
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"
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"
Hi ,
Can you please share BR condition expression.
Hi,
Is the scope of the BR is Entity level? Do you think it could be related to timezone conversion thing?
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.
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.)
Mohamed Amine Mahmoudi
83
Super User 2025 Season 1
Community Member
54
Victor Onyebuchi
6