I'm trying to build a formula that says if start date field is <= today & end date field is >= today or start date field is <=today & end date field is black then active checkbox = true
I'm trying to build a formula that says if start date field is <= today & end date field is >= today or start date field is <=today & end date field is black then active checkbox = true
Hi Braedon Owen,
I was able to achieve this functionality with the following formula on a calculated checkbox field:
or(and(not(isAfter($start_date_c,now())),not(isBefore($end_date_c,today()))),and(not(isAfter($start_date_c,now())),not(greaterThan(strlen(toString($end_date_c)),0))))
Here are a few notes regarding the formula and behavior:
I hope this helps!
That works perfectly, thanks Chris!
I do have another question surrounding this; will the record automatically update itself to say inactive/active or would that be a process that is created?
for example, a promotion is created with start date tomorrow. When I save that, the checkbox for 'active' will be false, will it show active tomorrow automatically?
Hi Braedon,
In learning more about the defects with using isAfter() and today() together from Sugar Support, I was able to craft a better formula that improves the user experience. I updated the original post with that new formula and comments.
Hi Braedon,
In learning more about the defects with using isAfter() and today() together from Sugar Support, I was able to craft a better formula that improves the user experience. I updated the original post with that new formula and comments.