Business Need: We have some custom fields on Account records that need to be populated based on field values of the most current Contract record related to the Account. These are the custom fields on the Account
- Latest Contract - Lookup Relationship that pulls from Contract ID Latest Contract
- Start Date - Date field that pulls from Contract Start Date Latest
- Contract End Date - Date Field that pulls from Contract End Date
- Latest Contract Status - Test field that pulls from Contract Status
- Latest Contract Term (months) - Number field that pulls from Contract Term
I built a Record Triggered Flow that updates these fields when a Contract is record created or updated.
Problem: These fields are being modified when any Contract related to the Account is updated. For example, if an older Contract related to the Account is modified, the custom fields on the Accounts update to the information on the older contract.
Is there a way I can modify the flow to only look at the most current Contract related to the Account, and update the Account fields when the most current Contract fields are updated? If I configure the trigger to run when a record is created, it pulls the latest Contract created. However it only updates the Account field values to the values on the Contract fields at the time of creation
Below are pics of the flow I built:
Thank you so much for your time and consideration!