Hi,
how to restrict an integer field in form to allow only 4 characters?
*This post is locked for comments
Hi,
how to restrict an integer field in form to allow only 4 characters?
*This post is locked for comments
It may need a bit better specification. For example, -123 has three figures, but four characters. What result would you like to get in this case?
You have to write your logic in ValidateField method on that Table
Here is the sample
public boolean validateField(fieldId _fieldIdToCheck) { boolean ret; ret = super(_fieldIdToCheck); if (_fieldIdToCheck == fieldNum(TableName, IntegerField)) { if (strlen(int2str(this.IntegerField)) > 4) { ret = checkFailed('only 4 characters or allowed'); } } return ret; }
DisplayLength Property still allow the user to enter any length of character. In form it will show only the defined display length.
The above code will help you to validate the user entry.
Kempeth
4
Andy Adamak
4
Community Member
4