This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
WP Table insert rows
|
WP Table insert rows ( targetObj | {tableRef ; rowNumber} {; numRows} ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
targetObj | Object |
![]() |
Range or element or 4D Write Pro document | |||||
tableRef | Object |
![]() |
Table reference | |||||
rowNumber | Longint |
![]() |
Row index number | |||||
numRows | Longint |
![]() |
Number of rows to insert (default value = 1) | |||||
Function result | Object |
![]() |
Range of table rows | |||||
The WP Table insert rows command inserts one or several row(s) into a 4D Write Pro table.
This command supports two syntaxes:
The optional numRows parameter defines the number of rows to insert into targetObj or tableRef. By default, if this parameter is omitted, one row is inserted.
Result
The command returns a row range representing inserted row(s), or Null if nothing was inserted.
You want to insert two rows at the end of the Invoice table:
C_OBJECT($row)
C_OBJECT($table;$row)
C_LONGINT($rowNum)
$table:=WP Get element by ID(WParea;"Invoice") //retrieve "Invoice" table
If($table#Null)
$rowNum:=$table.rowCount+1 //add 1 to last row to designate where to insert rows
$row:=WP Table insert rows($table;$rowNum;2)
End if
will insert the two new rows at the correct location:
Product: 4D
Theme: 4D Write Pro Language
Number:
1691
Created: 4D v18
4D Write Pro Reference ( 4D v20 R7)