Fields
Display length of data entered in a field
Use this LPL code to determine the number of characters entered in a field.
Create a transient field:
Transient Fields
ZZZGetFieldLength is Numeric size 2
Default label is untranslatable:”Get field length”
Then create a form configuration and set the value of the transient field = to <user input field> size. In this example, it’s RequisitionDescription. In order to visually display the output, I’m using the when value changed to automatically update the value to the transient field that has been added to a form. Note that if you don’t want to display the field on the form, but want to use the when value changed for another purpose in your code, make the field hidden
RequisitionDescription
when value changed
ZZZGetFieldLength = RequisitionDescription size
Restrict spaces entered in a field
Use this example to restrict spaces from getting entered into a field.
First, create a derived user field to be used in a subscript.
Transient Fields
ZZZSubscript is Numeric size 2
Then, use an action configuration with an entrance rule to loop through the values entered by the user.
Vendor.ZZZSubscript = Vendor.Reference1 size
while (Vendor.ZZZSubscript > blank)
constraint (Vendor.Reference1[Vendor.ZZZSubscript] entered)
"EmbeddedSpacesNotAllowed"
Vendor.ZZZSubscript -= 1
Increasing the size of a text field
email from Andrew on 3/16
use text area of n lines
E.g.
Description
use text area of 10 lines
Ensure a field is entered
If you need to ensure a field is entered, you can create an action configuration and use LPL to create an entrance rule. This is typically done with an update or create action. This is an entrance rule that ensures the Reference1 field is populated if a Vendor record is active.
if (Vendor.VendorStatus.Active)
constraint (Vendor.Reference1 entered)
"Reference1FieldIsRequiredOnActiveVendorRecords"
Return first three characters of a field
Example to create a derived user field to return the first three characters of a field.
Derived Fields
ZZZThreeChar is a DerivedField
type is Alpha size 3
default label is untranslatable:”Display first three characters”
return Reference1[0:3]