RemoveCustomTable

You can use the RemoveCustomTable function to remove all rows from an extension table for an Optiva object. The function clears all data from the specified custom or extension table.

When to use

You can use this function to:

  • Clear all rows from an extension table.
  • Perform batch operations to clear extension table data.

When not to use

You cannot use this function:

  • To clear specific cells. Use ObjPropertyRemove.
  • To remove standard object data. Use ObjectDelete function.
  • When selective row removal is required.

Syntax

long RemoveCustomTable(string DataTableName, string objSymbol, string objKey)

Parameters

Parameter Type Required Description
objSymbol string Optional

The symbol of the object.

Note: You can use empty quotation marks ("") for the current workflow symbol.
objKey string Optional

The key of the object.

Note: You can use empty quotation marks ("") for the current workflow symbol.
DataTableName string Yes The name of the extension or custom table (as per Extension table definition) related to the specific object.
Note: The name must match the table name defined in the extension table configuration.

Return Value

The application returns a value greater than zero (0) if the operation is successful, or else the operation is failed.

Impact

  • The application immediately persists changes to the database.
  • The function permanently deletes all rows from the specified extension table.
  • You cannot undo the operation without database restoration.

Examples

Example 1
Remove All Rows from Custom Table for Specific Item.
RemoveCustomTable("CustomTable1", "ITEM", "T0001");
Description
This example removes all rows from CustomTable1 for the item 10001.
Example 2
Remove All Rows from Custom Table for New Object in Copy Method.
string sRemoveCustomTable = RemoveCustomTable("CustomTable1");
Description
This example removes all rows from CustomTable1 for a new formula. The new formula is being created by a copy method.