Sets the value of a process table field.
Please note: This function writes data to the database only after markActivityAsCompleted is called.
Parameter |
Type |
Description |
|---|---|---|
$fieldname |
string |
Name of the process table field |
$value |
mixed |
New value of the process table field |
The parameter $value must be passed differently depending on the type of the process table field:
Type |
Format |
Example |
|---|---|---|
Text |
As text |
Text … |
Integer |
As integer |
1000 |
Dezimal |
As decimal value |
1000.00 |
Long text |
As 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:
// set text field
$this->setTableValue('NAME', 'JOHN SMITH');
// set numeric field
$this->setTableValue('NUMBER', 1000);
// set decimal field
$this->setTableValue('PRICE', 1000.12);
// set date
$this->setTableValue('DATE', '2012-01-20');
// set date and time
$this->setTableValue('DATE', '2012-01-20 12:34:20');