LPL to default a value

 2 Replies
 1 Subscribed to this topic
 32 Subscribed to this forum
Sort:
Author
Messages
giesewendy
Advanced Member Send Private Message
Posts: 33
Advanced Member

I want to place a default into several fields on some of our forms.  Does anyone have basic LPL code for that?

 

Woozy
Veteran Member Send Private Message
Posts: 709
Veteran Member
Hi giesewendy,

Just to be clear, there is a difference between "Default" and "Initial Value".  Default means that every record is automatically assigned this value unless it is overridden and if you delete the override value then the default value will be assigned.  Initial Value is the value that is populated into the form when you create a "new" record - but that value would not be assigned automatically to any other records.

I don't believe it is possible to assign a true "Default" value to a delivered business class field, although you can do this to a custom UserField.  It has to be done a the field level rather than the form level.

You can assign an Initial Value for a field at the form level OR (for custom UserFields) the field level.   Here is a sample of how this is done at the form level for a "constant" value:

LRCJobContextForm is a Form     title is "JobContextForm"     Layout         three column             effective date             Job                 display as text             ShortDescription                 initial value is "KMTesting"         paragraph             Description

 

You can also have it use existing related field name value by replacing the "KMTesting" with the related fieldname.

I hope this helps!

Kelly

Kelly Meade
J. R. Simplot Company
Boise, ID
giesewendy
Advanced Member Send Private Message
Posts: 33
Advanced Member
thank you