version 6.8.1
PV UPDATE DYNAMIC AREA (area)
| Parameter | Type | Description | |
| area | Longint | 4D View area |
Description
The PV UPDATE DYNAMIC AREA command causes the synchronization of the data present in the 4D View area and those of the 4th Dimension database.
This command is useful within the context of callback methods used in dynamic areas only. In fact, when a callback method causes the modification of the current selection of 4th Dimension, the 4D View area is only updated at the end of execution of the entire method. However, if in this case commands such as PV GOTO CELL are used in the callback method, the result obtained could be incorrect due to the temporary lag between 4th Dimension data and those of 4D View. To avoid this risk, it is necessary to call the PV UPDATE DYNAMIC AREA command during the callback method in order for the data of the 4D View area to immediately reflect any modifications carried out on those of 4th Dimension.
PV UPDATE DYNAMIC AREA causes the update of the 4D View area if the 4th Dimension selection has undergone at least one of the following modifications:
Modification of the current selection within the context of linked fields,
Modification of the size of linked arrays,
Modification of the data of linked fields or arrays.
Example
This example continues that of the PV ADD DYNAMIC FIELDS command (enabling the linking of the 4D selection to the 4D View area). We install an on "right click" event method used to create a record in the 4D selection and to position itself on this record in the 4D View area.
PV ON EVENT (area;pv on right clicked;"CallbackMethod")
The code of the CallbackMethod project method is as follows:
C_BOOLEAN($0) C_LONGINT($1;$2;$3;$4;$5;$6) $0:=True `Blocks event CREATE RECORD([Contacts]) `New record SAVE RECORD([Contacts]) `Saving of created record ALL RECORDS([Contacts]) `Updating of the 4D View selection in relation to that of 4th Dimension PV UPDATE DYNAMIC AREA (area) `Selection of new record PV GOTO CELL (area;1;Records in selection([Contacts]))
See Also
PV ADD DYNAMIC ARRAYS, PV ADD DYNAMIC FIELDS, PV CLEAR DYNAMIC COLUMNS.