Please enable JavaScript to view this site.

The manual for the JobRouter developer

Navigation: System activities > Description of the PHP API for system activities > API methods > Work with subtables

setSubtableValue(string $subtable, int $row, string $fieldname, string $value): void

Scroll Prev Top Next More

Sets the value of a subtable field or adds a row depending on $row.

Please note: This function writes data to the database only after markActivityAsCompleted is called.

Parameter

Type

Description

$subtable

string

Name of the subtable

$row

int

ID of the row

$fieldname

string

Name of the column

$value

string

New value

The parameter $value must be passed differently depending on the type of the subtable field:

Type

Format

Example

Text

As text

Text …

Integer

As integer

1000

Decimal

As decimal value

1000.00

Long text

As long text

Text …

Date (Datetime)

Input in format YYYY-MM-DD HH:MM:SS

2012-01-20 12:23:45

 

Date (Timestamp)

As a UNIX timestamp

1330709994

If an error occurs, the function throws a JobRouterException.

Example:

$this->setSubtableValue('INVOICEPOSITIONS', 5, 'MATERIAL', '12345');