Class PayrunEmployeeAvailableFunction
Determines whether an employee participates in the current payrun (default: true).
Implements
Inherited Members
Namespace: PayrollEngine.Client.Scripting.Function
Assembly: PayrollEngine.Client.Scripting.dll
Syntax
public class PayrunEmployeeAvailableFunction : PayrunFunction, IDisposable
Remarks
This function is evaluated once per employee, before any wage types or collectors are
processed for that employee. Returning false skips the employee entirely: no
PayrunEmployeeStartFunction, no wage types, no collectors, no
PayrunEmployeeEndFunction will execute for the skipped employee.
Typical uses:
- Exclude employees based on a case field attribute (e.g. employment status, level).
- Restrict processing to specific periods or cycle phases (e.g. annual bonus payrun).
- Skip employees without a required case value in the current period.
Return value: Return true or null to include the employee.
Return false to exclude the employee from this payrun.
Examples
// Include only senior employees
(int)Employee["Level"] >= 2
// Include only in the last period of the cycle (e.g. annual bonus payrun)
LastCyclePeriod
// Exclude employees without an active contract case value
GetCaseValue<string>("ContractStatus") == "Active"
Constructors
View SourcePayrunEmployeeAvailableFunction(object)
Initializes a new instance with the function runtime
Declaration
public PayrunEmployeeAvailableFunction(object runtime)
Parameters
| Type | Name | Description |
|---|---|---|
| object | runtime | The runtime |
PayrunEmployeeAvailableFunction(string)
New function instance without runtime (scripting development)
Declaration
protected PayrunEmployeeAvailableFunction(string sourceFileName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | sourceFileName | The name of the source file |
Remarks
Use GetSourceFileName(string) in your constructor for the source file name
Methods
View SourceIsAvailable()
Entry point for the runtime
Declaration
public bool? IsAvailable()
Returns
| Type | Description |
|---|---|
| bool? |
Remarks
Internal usage only, do not call this method