Code On Time web applications automatically limit the amount of text that users are allowed to enter in the text-based input fields. The following screen shot shows the createForm1 form view rendered in the new mode.
Users are not able to enter more than 5 characters in the Customer ID and 30 characters in the Contact Name accordingly.
The length of fields is controlled by the Length property of data controller fields. The fields with the type String inherit the limit from the maximum length of the database table column. The limit applies to both single-line and multi-line text boxes.
The list of fields in Customers data controller is shown next. Column Len shows the values assigned by the code generator.
You can also select any String field in Project Explorer and change the Length property there.
The database exception will be raised if the Length property of a field is left blank and a user enters more data than the database is expecting. The record will remain in the edit or new mode.
An error message is displayed if the Length property of the ContactName is cleared and more than 30 characters are enters when creating a new record.