4D v16.3REJECT |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16.3
REJECT
REJECT
REJECT has two forms. The first form has no parameters. It rejects the entire data entry and forces the user to stay in the form. The second form rejects only aField and forces the user to stay in the field. Note: You should consider the built-in data validation tools before using this command. The first form of REJECT prevents the user from accepting a record that is not complete. You can achieve the same result without using REJECT — you associate the Enter key with a No Action button and use the ACCEPT and CANCEL commands to accept or cancel the record, after the fields have been entered correctly. It is recommended that you use this second technique and do not use the first form of REJECT. If you use the first form, you execute REJECT to prevent the user from accepting a record, usually because the record is not complete or has inaccurate entries. If the user tries to accept the record, executing REJECT prevents the record from being accepted; the record remains displayed in the form. The user must continue with data entry until the record is acceptable, or cancel the record. The best place to put this form of REJECT is in the object method of an Accept button associated with the Enter key. This way, validation occurs only when the record is accepted, and the user cannot bypass the validation by pressing the Enter key. The second form of REJECT is executed with the field parameter. In this case, the cursor stays in the field area, which forces the user to enter a correct value. You can use HIGHLIGHT TEXT to select the data in the field that is being rejected. The following example is for a bank transaction record. It shows the first form of REJECT being used in an Accept button object method. The Enter key is set as an equivalent for the button. This means that even if the user presses the Enter key to accept the record, the button’s object method will be executed. If the transaction is a check, then there must be a check number. If there is no check number, the validation is rejected: Case of The following example is part of an object method for an [Employees]Salary field. The object method tests the Employees]Salary field and rejects the field if it is less than $10,000. You could perform the same operation by specifying a minimum value for the field in the form editor: Case of
See also
|
PROPERTIES
Product: 4D
HISTORY
Created: < 4D v6 ARTICLE USAGE
4D Language Reference ( 4D v16) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||