When Value Changed LPL syntax
You can add when value changed
LPL syntax to a field in a configured or user-defined form.
When a field value on a form is changed, the list of form field assignments and refreshes will be executed without a save action. A refresh will cause a related field or derived field to be recalculated based on the current values on the form.
Example: refresh a derived field
Calculator is a simple form with four fields: Interest Rate, Loan Amount, Term, and Monthly Payment. Monthly Payment is a derived field based on the value in the other fields. This form will automatically update the value in Monthly Payment when the user changes the values in Interest Rate, Loan Amount, or Term, without the user having to save the form.
Calculator is a form
Layout
single column
InterestRate
when value changed
refresh MonthlyPayment
LoanAmount
when value changed
refresh MonthlyPayment
Term
when value changed
refresh MonthlyPayment
MonthlyPayment
display only
Example: avoid duplicate entry
In this form, Pay Period Start Date is a date field. The organization's requirement is the record must become effective the same date as the Pay Period Start Date. You can use when value changed
syntax so users do not have to enter the same date twice or possibly cause an error by mistakenly entering two different dates. You can also hide the effective date from the user interface to simplify entry for the users.
Sample is a form
Layout
single column
effective date
PayPeriodStartDate //user business class that implements user defined states
when value changed
effective date = PayPeriodStartDate