Expand my Community achievements bar.

Join us LIVE in San Francisco on November 14th for Experience Makers The Skill Exchange. Don't miss out on this free learning event!

Formatting Date Logic to Set YYYY Within 365 Days

Avatar

Level 1

Background:

We have customers in Salesforce that have an "enrollment date" when they join a specific program of ours. And, we have respective "engagement date" and "renewal date" fields on our project custom forms within Workfront.

Currently, Fusion runs a daily scan of all customers in Salesforce that enrolled that same day (MM/DD the year doesn't matter) and compares against WF to see if they already have an open project, and if not, Fusion sets them up with one. For this same-day enrollment/project creation process, we have Fusion auto populate the two custom fields on projects with dates that mark the enrollment date as today, and the renewal date is pushed out 365 days from the day the project is created (this should always match their enrollment date MM/DD, just with the next year).

We need to be able to initiate quarterly ad hoc runs of this scenario to make sure no enrolled customers fell through the cracks and missed out on getting a project created in Workfront. With that said, I'm struggling to figure out how to frame the logic/date formatting on our ad hoc scenario to align the renewal date on the custom form to the "Enrollment Date" field in Salesforce. 

Example:

Customer in Salesforce enrolled 07/03/2024

Fusion sets up the project today in an ad hoc/cleanup run. Engagement date on custom forms would be set to 09/06/24 which is fine, but the Renewal Date on custom form would be set to 09/06/25. 

We need that renewal date field to be set to 07/03/2025 - is it possible to frame the logic so that it matches the MM/DD of the SF enrollment date, but makes sure that the renewal year is within 365 days or less? What we don't want it to do, is say a customer enrolled 10/10/2023, and the ad hoc run is just now catching it, so it sets the engagement date to today (09/06/2024) but pushes the renewal date to 10/10/2025 - that would mean the project age would be over 365 days by the time the renewal date came around. We would want the renewal date to be 10/10/2024, as it always needs to be within 365 days or less of the engagement date, even if that means the project should end/renew in a few days/months. 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Reply

Avatar

Level 3

Hi @ElaineRi 

Something in your example confuses me: 

Example:

Customer in Salesforce enrolled 07/03/2024

Fusion sets up the project today in an ad hoc/cleanup run. Engagement date on custom forms would be set to 09/06/24 which is fine, but the Renewal Date on custom form would be set to 09/06/25.  


From your description it sounds like you want that user to have a renewal date of 07/03/2025 no? 

I think what you want to do is use the SF enrollment date: 

  1. get the month and date of SF enrollment date
  2. add the current year

What do you do when that date is in the past? 

Enrolled 3/7/2023

Engagement - 9/6/2024

Renewal should have been 3/7/2024 but was missed?