Skip to main content

Create Compensation Rules

Use Compensation Rules to assign recurring pay or deductions to employees in a Payroll Territory. Dynamic rules can calculate amounts from employee or Payroll Run data.

Who can use this?

HR Admins and payroll teams in Salesforce. Salesforce Admin access is required to create formula fields in Object Manager or grant API permissions.

Create a fixed Compensation Rule

  1. Open the Payroll Territory, then select Compensation Rules.
  2. Click New. You can also find Compensation Rules in the App Launcher (⋮⋮ grid icon) and click New.
  3. Enter a rule name.
  4. Set Start Date and End Date.
  5. In Recurring Period in Months, enter the interval. Use 1 for monthly, 2 for every two months, or 0 for every Payroll Run.
  6. In Amount, enter the fixed compensation value.
  7. Click Save. flair applies the rule to employees in the territory for the defined period.

If Payroll Territory is empty, the rule applies to employees who do not belong to a territory. flair also applies rules when a new employee joins a territory or an employee changes territory.

Fixed Compensation Rule with its period and amount

Review the current Payroll Run or Employee Recurring Compensation – Rules on an employee record to confirm the results.

warning

Changing the rule's Payroll Territory deletes future compensations and creates replacements for the new territory. Deleting a rule deletes related compensation except line items in locked or completed Payroll Runs.

Create a dynamic rule from employee data

An employee compensation rule can vary by employee data, such as years of service or performance, instead of using a fixed Amount.

Create the formula field

  1. In Salesforce Setup, open Object Manager.
  2. Enter Employee Recurring Compensation in Quick Find, then open the object.
  3. Open Fields & Relationships, then click New.
  4. Select Formula, then click Next.
  5. Enter a Field Label, such as Years of Service Bonus.
  6. Set Formula Return Type to Currency, then click Next.
  7. In Advanced Formula, click Insert Field.
  8. Select Employee Recurring CompensationEmployeeYears of Service, then click Insert.
  9. Add the required operator or enter the formula. For a value of 10 per service year, multiply the field by 10.
  10. Click Next, skip the field-level security step if appropriate, then click Save.

Formula editor for a years-of-service compensation field

Apply the formula to the rule

  1. In Fields & Relationships, open the formula field and copy Field Name.
  2. Return to the Compensation Rule.
  3. In Amount Formula, paste the field name.
  4. In Base Object API Name, enter flair__Employee_Additional_Compensation__c.
  5. For a rule that does not use Employee Rates, keep Rate Type set to None.
  6. Click Save.
  7. Open Related, then review the calculated values in Amount.

If Rate Type is None, the rule applies to all employees in the selected Payroll Territory.

Dynamic formula connected to a Compensation Rule

Create a dynamic rule from salary

This example multiplies years of service by one percent of salary. Every affected employee needs an Employee Rate.

Create the Employee Rate

  1. Open the employee record, then select Salary.
  2. In Employee Rates, click New.
  3. Enter Employee Rate Name.
  4. Set Rate Type to Salary.
  5. In Amount, enter the employee's salary.
  6. Click Save.

Employee Rate with Salary selected as its Rate Type

Update the salary formula

  1. Create or edit the formula field for the rule.
  2. Add flair__Employee1__r.flair__Years_of_Service__c.
  3. Click Insert Field, then select Employee Recurring CompensationReference Employee RateAmount.
  4. Multiply the reference rate by 0.01.
  5. Confirm that the complete formula is flair__Employee1__r.flair__Years_of_Service__c * flair__Reference_Employee_Rate__r.flair__Amount__c * 0.01.
  6. Click Save.
  7. On the Compensation Rule, set Rate Type to Salary.
  8. If you edited an existing formula, click Recalculate Compensation.

Recalculate Compensation action on an updated rule

Create a Payroll Run Rule

Payroll Run Rules calculate compensation from run-specific data, including standard, overtime, or public-holiday hours.

  1. Create a Compensation Rule with a name and Start Date.
  2. In Recurring Period in Months, enter 0 to apply it to every Payroll Run.
  3. In Dynamic Formula, set Base Entity API Name to flair__Employee_Payroll_Run_Line_Item__c.
  4. In Rate Type, select Public Holiday Hours, Overtime Hours, or Standard Hours.
  5. In Salesforce Setup, open Object ManagerEmployee Payroll Run Line ItemFields & Relationships.
  6. Find the formula field, such as Public Holidays Compensation, then copy Field Name.
  7. Return to the rule and paste the value into Amount Formula.
  8. Click Save.

The recurring compensation initially shows 0 because the calculation needs hours from a Payroll Run.

Base Entity API Name and Rate Type for a Payroll Run Rule

For each affected employee, create an Employee Rate on Salary with the matching Rate Type and hourly Amount. For example, an amount of 30 for Public Holiday Hours pays €30 per public-holiday hour.

Add a deduction

Negative compensation appears in the Deductions column. Total shows compensation before deductions, and Total Net shows the value after deductions.

Add a deduction to one Payroll Run

  1. Open the Payroll Run and select the employee.
  2. Click Add New Compensation.
  3. Enter a description in Other Compensations.
  4. In Amount, enter a negative value, such as -100.
  5. Click Save. The value appears under Deductions, and Total Net updates.

Deduction and updated Total Net in a Payroll Run

Add a recurring or one-time deduction

  • For a regular deduction, open the employee's Salary tab and create Employee Recurring Compensation with a negative amount.
  • For a single deduction, create Employee One-time Compensation with a negative amount.

Add deductions through an API

  1. Move the Payroll Run to a locked Submitted stage.
  2. Assign the custom permission for payroll API access to the integration user.
  3. Through the API, create compensation line items with negative amounts.

Use the available method based on the deduction:

MethodWhen to use it
Employee Recurring CompensationA fixed deduction that repeats, such as a monthly loan repayment.
Employee One-time CompensationOne deduction in a specific period.
Payroll Run Line ItemAn ad hoc deduction in one run or imported from another system.
Compensation RulesA rule-based deduction for several employees.