4D v14.3Modified |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
Modified
Modified
This function is kept for compatibility reasons only since it is based on the former management of execution cycles, which is itself obsolete since version 6 (see the Before, During, etc. commands). In most cases, it is now strongly recommended to use the Form event command and to check whether it returns the On Data Change event. Modified (obsolete) returns True if field has been programmatically assigned a value or has been edited during data entry. The Modified command must only be used in a form method (or a subroutine called by a form method). Be careful, this command only returns a significant value within the same execution cycle. It is more particularly set to False for all the form events that correspond to the former During execution cycle. During data entry, a field is considered modified if the user has edited the field (whether or not the original value is changed) and then left it by going to another field or by clicking on a control. Note that just tabbing out of a field does not set Modified to True. The field must have been edited in order for Modified to be True. When executing a method, a field is considered to be modified if it has been assigned a value (different or not). Note: Modified always returns True after the execution of the PUSH RECORD and POP RECORD commands. In all cases, use the Old command to detect whether the field value has actually been changed. Note: Although Modified can be applied to any type of field, if you use it in combination with the Old command, be aware of the restrictions that apply to the Old command. For details, see the description of the Old command. During data entry, it is usually easier to perform operations in object methods than to use Modified in form methods. Since an object method is sent an On Data Change event whenever a field is modified, the use of an object method is equivalent to using Modified in a form method. Note: To operate properly, the Modified command is to be used only in a form method or in a method called by a form method. The following example tests whether either the [Orders]Quantity field or the [Orders]Price field has changed. If either has been changed, then the [Orders]Total field is recalculated. If((Modified([Orders]Quantity)|(Modified([Orders]Price)) Note that the same thing could be accomplished by using the second line as a subroutine called by the object methods for the [Orders]Quantity field and the [Orders]Price field within the On Data Change form event. You select a record for the table [anyTable], then you call multiple subroutines that may modify the field [anyTable]Important field, but do not save the record. At the end of the main method, you can use the Modified command to detect whether you must save the record: ` Here the record has been selected as current record |
PROPERTIES
Product: 4D
HISTORY
Modified: 4D 2004 SEE ALSO ARTICLE USAGE
4D Language Reference ( 4D v11 SQL Release 6) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||