Rate Card Automation
Background
Use this step by step guide to create a flow so that the Rate Card is automatically saved to the Time Tracking Summary, when using the Batch Entry and Easy Calendar.
Create a Record-Triggered Flow (Before Save)
This guide details how to create a highly efficient Before-Save Record-Triggered Flow on the Time Tracking Summary object. The flow will automatically look up the correct Default User Rate Card based on the Entered for User and set the corresponding Rate Card field on the Time Tracking Summary record.
Flow Summary
Setting | Value |
|---|---|
Flow Type | Record-Triggered Flow |
Object | Time Tracking Summary |
Trigger | A record is created or updated |
Run Time | Before the record is saved (Fast Field Updates) |
Step 1: Create the Flow and Define the Trigger
Navigate to Setup and search for Flows.
Click New Flow.
Select Record-Triggered Flow and click Create.
Configure the Trigger Settings
Object: Select the Time Tracking Summary object (use the API name if necessary, e.g.,
Time_Tracking_Summary__c).Trigger: Select A record is created or updated.
Optimize the Flow: Select Fast Field Updates (Before Save).
Your initial setup should look like this:
Setting | Selection |
|---|---|
Run Flow When | A record is created or updated |
Optimize the Flow For | Fast Field Updates |
Click Done.
Step 2: Set the Entry Conditions
We only want the flow to proceed if the record is being created, OR if it's being updated and the Entered for User field is changing.
On the starting element, click the + sign and select Condition Requirements.
Condition Requirements: Select Custom Condition Logic Is Met.
Define the following conditions (using the API name for the Entered for User field, e.g.,
TTracking__Entered_For__c):
Resource | Operator | Value |
|---|---|---|
| Is Null |
|
OR |
|
|
| Is Changed |
|
Custom Condition Logic: Enter
1 OR 2. This means the flow runs if (1) the record is new, OR (2) the record is updated and the field changed.
Click Done.
Step 3: Get the User's Default Rate Card
This step queries the User Rate Card object to find the specific default record for the entered user.
Click the + sign after the Entry Conditions and select Get Records.
Label:
Get Default User Rate CardAPI Name:
Get_Default_User_Rate_CardGet Records from this Object: Select the User Rate Card object (e.g.,
TTracking__User_Rate_Card__c).Filter User Rate Card Records: Set the filter conditions:
Field (User Rate Card) | Operator | Value (Time Tracking Summary Record) |
|---|---|---|
| Equals |
|
| Equals |
|
How to Store Record Data:
How many records to store: Only the first record (Since the criteria is for the default card, there should only be one).
How to Store Field Data: Automatically store all fields.
Click Done.
Step 4: Check if a Rate Card was Found (Decision)
Before attempting to use the retrieved record, we must check if the Get Records step actually found anything.
Click the + sign after the Get Default User Rate Card step and select Decision.
Label:
Was Default Rate Card Found?API Name:
Was_Default_Rate_Card_FoundOutcome 1 (True Scenario):
Label:
Found Rate CardAPI Name:
Found_Rate_CardCondition:
{!Get_Default_User_Rate_Card}Is Null{!$GlobalConstant.False}(Checking that the collection variable is not empty).
Default Outcome:
No Rate Card Found(This path does nothing).
Click Done.
Step 5: Assign the Rate Card to the Triggering Record
This step runs only if the Decision determined a Rate Card record was found. Since this is a Before-Save flow, we use the Assignment element to update the $Record variable.
Click the + sign under the Found Rate Card path and select Assignment.
Label:
Set Rate Card on TTSAPI Name:
Set_Rate_Card_on_TTSSet the Assignment Variables:
Variable | Operator | Value |
|---|---|---|
| Equals |
|
Note:
TTracking__Rate_Card__cis the lookup field on the Time Tracking Summary record we are updating.Get_Default_User_Rate_Card.Rate_Card__cis the Rate Card ID from the record we retrieved in Step 3.
Click Done.
Step 6: Save and Activate
Click Save in the top right corner.
Flow Label:
Time Tracking Summary - Set Default Rate CardFlow API Name:
Time_Tracking_Summary_Set_Default_Rate_Card
Click Save again.
Click Activate to make the flow live.
The Before-Save Flow automatically applies the changes made in the Assignment element to the database without needing a separate Update Records element.
Time Tracking is built by C323 and powered by Salesforce.