_setCustom
Sets the value of a custom element in a Contract.
Parameters
id
The ID of the Contract.
name
The name of the element.
value
The value of the element. Can take a single value or an array of values. For example, an array of values could be used to denote hours and minutes for a Time element.
Example
For a single value:
FM_api('Contract_setCustom', [
'id' => '1',
'name'=> 'Lorem',
'value' => 'Ipsum'
]);
For an array of values:
FM_api('Contract_setCustom', [
'id' => '1',
'name'=> 'Time',
'value' => ['4', '20']
]);
Result
On Success
{'ok':1}
On Failure
If the User is not logged in:
{'error':'not logged in'}
If the ID of the Contract is not given or is less than 1:
{'error':'invalid parameter: id'}
If the element name is not given:
{'error':'invalid parameter: name'}
If the element value is not given:
{'error':'invalid parameter: value'}
If the specified Contract does not exist:
{'error':'contract does not exist'}
Last updated