I am trying to create a calculated checkbox field names isLastMonth which return true if the given date is from last month.
I used this sugar Logic to execute it.
ifElse(isWithinRange(monthofyear(today()),2,12), ifElse(equal(subtract(monthofyear(today()),monthofyear($start_date_c)),1), true, false), ifElse(and(equal(subtract(number(subStr(toString(today()),12,15)),number(subStr(toString($start_date_c),6,9))),1),equal(monthofyear($start_date_c),12)), true, false))
It is working fine but the problem is when the month changes the checkbox is not automatically updating, It is being checked even though the month is changed, in order to update it I need to re-save that record or doing mass update for all the records.
Since there is an another field depending on this isLastMonnth Field it's not the best practice to update each record manually as month changes.
Can anyone suggest me a way to achieve it without re-saving the record.
Thanks in advance,