Language Reference Guide : 4. System Classes : ActiveField Class : UpdField Method
 
Share this page                  
UpdField Method
The UpdField method refreshes a displayed field.
This method has the following syntax:
ActiveField.UpdField([clearhasdatachanged = integer])
If the clearhasdatachanged parameter is set to FALSE when the UpdField method is used, the HasDataChanged attribute is not changed for the field or for any children of the field. Otherwise, using the UpdField method sets the HasDataChanged attribute to FALSE. For more information, see the HasDataChanged Attribute.
This method provides a way to keep displayed data synchronized between concurrent frames. For example, assume two concurrent frames, A and B, are displaying attributes of an object. If you change one of the attributes in Frame A and want to reflect that change in Frame B, you can use the SendUserEvent method to notify Frame B that the attribute has changed, and then use the UpdField method in Frame B to refresh the field that displays that attribute.
For more information about communicating between frames, see the Programming Guide.
Similarly, if you update a field through an alias, you must use the UpdField method to update the field display. For example, assume that you have a frame that contains a subform called test of type user_class. This subform has a field called entry_field. Also assume that the script for the frame contains the following code:
initialize(local_var = user_class) =
begin
     test.entry_field = 10;
end
...
locar_var = test;
local_var.entry_field = 12;
After this code is completed, the value of test.entry_field is 12, but the window still displays 10 in that field. To update the field, use the UpdField method:
field(test.entry_field).UpdField()
or
field(test).UpdField()