Class WageTypeResultFunction
Wage type function
Implements
Inherited Members
Namespace: PayrollEngine.Client.Scripting.Function
Assembly: PayrollEngine.Client.Scripting.dll
Syntax
public class WageTypeResultFunction : WageTypeFunction, IDisposable
Remarks
This function runs after WageTypeValueFunction has committed its result. The computed value is available as WageTypeValue. This hook is used to enrich, transform, or add supplementary output to the committed wage type result.
Typical uses:
- Add custom result entries (breakdowns, cost-centre splits) via AddCustomResult(string, decimal, IEnumerable<string>, Dictionary<string, object>, ValueType?, string).
- Set or update result attributes (SetResultAttribute(string, object)) for metadata that downstream reports or collectors consume.
- Apply result tags (SetResultTags(IEnumerable<string>)) for filtering or audit.
- Trigger a retro payrun when the result exceeds a threshold (ScheduleRetroPayrun(DateTime, IEnumerable<string>)).
Return value: Return null to leave the committed result unchanged.
Return a new decimal to override the wage type result.
The return value replaces the output of WageTypeValueFunction.
Low-Code / No-Code: Result post-processing can be expressed through
WageTypeResultAction attributes. The Result() entry point invokes all
registered actions before executing any inline script body.
Examples
// Split the result across two cost centres
AddCustomResult("KST-A", WageTypeValue * 0.7m);
AddCustomResult("KST-B", WageTypeValue * 0.3m);
// Schedule a retro run if the result changed significantly vs. last period
var last = GetConsolidatedWageTypeResults(
new WageTypeConsolidatedResultQuery(WageTypeNumber, 1)).FirstOrDefault();
if (last != null && System.Math.Abs(WageTypeValue - last.Value) > 500m)
ScheduleRetroPayrun(PreviousPeriod.Start);
Constructors
View SourceWageTypeResultFunction(object)
Initializes a new instance with the function runtime
Declaration
public WageTypeResultFunction(object runtime)
Parameters
| Type | Name | Description |
|---|---|---|
| object | runtime | The runtime |
WageTypeResultFunction(string)
New function instance without runtime (scripting development)
Declaration
protected WageTypeResultFunction(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
Properties
View SourceWageTypeValue
The wage type value
Declaration
[ActionProperty("Wage type value", null)]
public decimal WageTypeValue { get; }
Property Value
| Type | Description |
|---|---|
| decimal |
Methods
View SourceResult()
Entry point for the runtime
Declaration
public object Result()
Returns
| Type | Description |
|---|---|
| object |
Remarks
Internal usage only, do not call this method