AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Controles, páginas y ventanas / Funciones Tabla
  • Use conditions
  • Updating the data file linked to the Table or TreeView Table control
  • Cascading input and update of linked data file
  • Re-displaying the row that was saved
  • Locking and updating the data file
  • Duplicates and referential integrity
  • Use TableSave to reduce the number of lines of code
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Updates or adds the record bound to the current row in the Table or TreeView Table control. The record is updated:
  • in the data file linked to the control.
Ejemplo
// Save the data found on the current row 
// for the "TABLE_Product" control
TableSave(TABLE_Product)
// Save the data found on row 5 
// while modifying a column programmatically
TABLE_Product = 5
TABLE_Product[5].COL_Cap = "new value"
TableSave(TABLE_Product)
// Event Row exit
IF TABLE_Customer.Modified = False THEN
	RETURN 
END
pclFormPresentation is PCustomerForm dynamic
IF TABLE_Customer.NewLine THEN
	pclFormPresentation<-gclPresentation.New()
ELSE
	pclFormPresentation<-gclPresentation.Modify()
END
TableSave(TABLE_Customer, pclFormPresentation)
Sintaxis

Saving in a data file Ocultar los detalles

TableSave(<Table control>)
<Table control>: Control name
Name of the Table or TreeView Table control based on a data file to be used. The current row of this Table control will be saved.
If this parameter corresponds to an empty string (""), the Table control to which the current process belongs will be used.
Observaciones

Use conditions

TableSave can be used on:
  • a Table control based on a data file or a TreeView Table control based on a data file.
  • single-selection or multi-selection controls. For a multi-selection control, only the last selected record is modified (the record corresponding to the last current row).

Updating the data file linked to the Table or TreeView Table control

TableSave saves the current control row in the data file linked to the control. The items are automatically assigned with the values of associated columns in the current row.
When a modification is performed, TableSave replaces the former values by the new ones. The items not found in the control are not modified.
Caution:
  • TableSave only manages the data file associated with the control. If some columns are linked to items found in other data files, these data files are not automatically managed.
  • The "image" columns are not saved by TableSave. To modify the content of the memo associated with the image (rare case), use HLinkMemo.
  • In the Check Box columns, the call to TableSave is implicit and it cannot be disabled. In any case, the modification of the value of check box will be applied to the data file.

Cascading input and update of linked data file

  • If the cascading input is enabled, the data file linked to the Table or TreeView Table control is automatically modified when the user goes to the next row (use of TableAdd, TableAddLine, TableInsert, TableInsertLine, TableModify and TableModifyLine). TableSave is useless.
  • If the cascading input is not enabled, the data file linked to the Table or TreeView Table control is not modified. To write the added or modified row into the linked data file, TableSave must be used after the addition or modification function.
Remarks:

Re-displaying the row that was saved

After the call to TableSave, the row saved may "disappear". This "disappearance" is due to the value of the search key for the added or modified record.
To avoid this problem, re-display the Table or TreeView Table control with TableDisplay.

Locking and updating the data file

If the data file is locked in the current process, TableSave saves the current row and unlocks the data file.

Duplicates and referential integrity

  • If the management of duplicates is enabled (HSetDuplicates), HErrorDuplicates must be checked after the execution of TableSave to check the key uniqueness.
  • If the management of referential integrity is enabled (HSetIntegrity), HErrorIntegrity must be checked after the execution of TableSave to check the referential integrity.

Use TableSave to reduce the number of lines of code

TableSave reduces several lines of code. This single line allows you to avoid assigning the item variables one by one.
For example, the following code:
Customer.LastName = LastNameColumn
Customer.FirstName = FirstNameColumn
Customer.Address = AddressColumn
Customer.ZC = ZCColumn
Customer.City = CityColumn
HAdd(Customer)
is replaced with the following line:
TableSave(TABLE_Customer)
Componente: wd300obj.dll
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2025

Señalar un error o enviar una sugerencia | Ayuda local