KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Assigning a text to a field as a default value
PRODUCT: 4D | VERSION: | PLATFORM: Mac & Win
Published On: January 12, 2001
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

In the Property list or Object Properties, you can assign a default value for a field. This option limits the number of character that you can assign to the field to 29 characters. If you assigned more than 29 characters, 4D will truncate the rest of the text starting from the 30th character. The quick way to get around this is to assign the value to the field programmatically. The following code will assign a text of 40 characters into the Field1 when the form is loaded.

Cut and Past the following code into your own 4D project:

If (Form event=On Load)
[Table1]Field1:="1234567890123456789012345678901234567890"
End if