Atlas-Assistance-Dogs / atlas-dogs

Repository for Atlas Dogs flows in Salesforce
1 stars 1 forks source link

Trainer Certification Valid Until only rolls forward if the new recert date is after the intial certification date #555

Closed atlasjen closed 5 days ago

atlasjen commented 1 month ago

This was just found in prod. image

We have the logic of basing the Trainer Certification Valid Until date on the date they initially certified + the next calendar year after their recertifcation. If a recertification is even a day or two before the initial certification date, the Valid until doesn't roll forward to the next year.

For example, above see the ones circled. these did not properly change valid until forward a year.

We are manually editing the date on the latest certification agreement to force these to roll forward.

atlasjen commented 1 month ago

Can you see if the same logic is in place for Team Facilitator Certification Valid Until? I bet it is. right now these are formula fields vs triggers.. i wonder about making them triggers so we have the option to overwrite them if we hit other logic changes.

deb761 commented 3 weeks ago

We would need to create a new field. We cannot change the type of a field in a managed package.

atlasjen commented 3 weeks ago

i think we should change them to new fields that are triggers.

So in terms of leeway.. do you mean how much before expiration can they renew? or how much after and still have it count as a renewal of the same term? I would say any amount before.. in terms of after.. let's say 30 days but can we make that configurable?

deb761 commented 3 weeks ago

The logic you gave me is that the Certification Valid Until date remains on the same day of the year as the initial Certification date. That is why the date would wind up not incrementing by a year if the renewal was before the expiration, because the Valid Until date was still after the renewal.

We need some kind of leeway for the before, and if after goes too long and the Certification date needs to change, we'll have to reset the Initial Certification Date, or have some other logic going on.

atlasjen commented 3 weeks ago

how about if it is w.in 90 days ahead of renewal date and w/in 30 days after.

deb761 commented 3 weeks ago

And what if the new agreement falls outside of those dates? Do you reset the ValidUntil to one year after the latest agreement?

atlasjen commented 1 week ago

will this be a trigger vs formula so we can always edit it after? kinda like we changed the board term valid until? if the new agreement is outside of that, yeah i guess 1 year after the latest agreement.

deb761 commented 1 week ago

This is a trigger. It's much easier to work complex logic that way also.