A PointsRuleType implemented in JS, configured per-account via the Queries repo's points-rules.xml. Its processFn function calculates the points to award a sales record's participant, and its optional includeFn function decides whether a record should be processed by this rule at all - when includeFn is not configured, every record is included. Configured as a points-rule element.

Group: Rewards

Implements: PointsRuleType


Properties

PropertyReturnsDescription
fieldsList<ExtraField>The configuration fields shown when setting up this rule on a points allocation source, as defined in the account's Queries repo configuration.
idStringUnique identifier for this rule instance, used to select it when configuring a points allocation source.
includeFnStringName of the optional JS function that decides whether a sales record should be processed by this rule. When configured, the function's result is coerced to a boolean, with true meaning the record is included. When not configured, every record is included.
processFnStringName of the JS function that calculates points for a sales record.
titleStringDisplay title shown when choosing a points rule type in the admin UI.

Methods

getId()

Returns: String

Unique identifier for this rule instance, used to select it when configuring a points allocation source.

getFields()

Returns: List<ExtraField>

The configuration fields shown when setting up this rule on a points allocation source, as defined in the account's Queries repo configuration.

getProcessFn()

Returns: String

Name of the JS function that calculates points for a sales record.

getIncludeFn()

Returns: String

Name of the optional JS function that decides whether a sales record should be processed by this rule. When configured, the function's result is coerced to a boolean, with true meaning the record is included. When not configured, every record is included.

getTitle()

Returns: String

Display title shown when choosing a points rule type in the admin UI.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.