Command PV SET CELL FIELD

4D View

PV SET CELL FIELD

version 6.8


PV SET CELL FIELD (area; column; row; table; field)

ParameterTypeDescription
areaLongint4D View area
columnLongintCell column number
rowLongintCell row number
tableIntegerTable number
fieldIntegerField number

Description

The PV SET CELL FIELD command links a field to cell area whose coordinates correspond to where column and row intersect.

table is the number of the table in which you want to link the current record to the cell. The displayed value is that of the field for the current record.

The cell is linked to field in a dynamic manner: any modification of the value is automatically reflected in the current record field and vice-versa.

Example

It is possible to build an input form composed of 4D View cells: each of them allowing visualization and modification of associated fields using the PV SET CELL FIELD command. The record could be handled by the callback method or another form object, for a looped entry:

   C_INTEGER($Table;$Field)  `Associated fields reference

   If (Form event=On Load )
      PV GET CELL FIELD (Area;2;1;$Table;$Field)  `Is a field linked to B1?
      If ($Table=0) & ($Field=0)
         PV SET CELL FIELD (Area;2;1;1;4)  `B1 : [Clients]LastName
      End if 

      PV GET CELL FIELD (Area;2;2;$Table;$Field)  `Is a field linked to B2?
      If ($Table=0) & ($Field=0)
         PV SET CELL FIELD (Area;2;2;1;3)  `B2 : [Clients]FirstName
      End if 
  
         `Labels
      PV SET CELL STRING VALUE (Area;1;1;"Last Name :")
      PV SET CELL STRING VALUE (Area;1;2;"First Name :")

      CREATE RECORD([Clients])  `New client entered
   End if 

See Also

PV ADD DYNAMIC FIELDS, PV GET CELL FIELD, PV Get cell value type, PV SET CELL VARIABLE.