The TSWrite function writes a value to a specific field on a specific record in a Sage 300 CRE Office database.
Syntax
TSWrite( table name , field name , value , action , [ key1 ] , [ ... keyn ] )
The TSWrite function syntax has these parts:
Argument | Description |
---|---|
table name | Required. This argument identifies a specific internal table name in the Sage 300 CRE Office database. |
field name | Required. This argument identifies a specific internal field name. The field name must identify a valid field for the table identified by the table name argument. |
value | Required. This argument specifies the value to be written to the field identified by the field name argument. |
action | Required. This argument specifies the desired action. |
key 1 ... key n | Required. These arguments provide the values of the primary key for the specific record desired. The number of key values and their meaning will depend on the table that was identified by the table name argument. |
Action
The following values can be used for action:
Action | Description |
---|---|
CreateOnly | If the record indicated by key 1 ... key n is not found, it will be created. Existing records will not be updated. |
CreateOrModify | If the record indicated by key 1 ... key n is found, it will be updated; otherwise it will be created. |
ModifyOnly | If the record indicated by key 1 ... key n is found, it will be updated; otherwise an error message is displayed on the Write Results Report. |
Ignore | No action will be taken.NOTE - Leaving this parameter blank has the same result as specifying Ignore |
Remarks
If multiple TSWrite functions write to the same record but specify different actions, a message will be displayed and you will be required to resolve all conflicting actions using the Approve Changes window before values can be sent to Sage 300 CRE.
If multiple TSWrite functions write to the same record and field, a message will be displayed and you will be required to remove the duplicates before values can be sent to Sage 300 CRE.
Example
Click here for examples.