ObjPropertyRemove

You can use the ObjPropertyRemove function to clear the value of an Optiva field from the database. The function removes or blanks field values in header fields or specific cells in detail tables without deleting the entire row.

When to use

You can use this function:

  • When clearing header field values (making them blank or null).
  • When removing specific cell values in detail tables.
  • During data cleanup or reset operations.

When not to use

You cannot use this function for complex multi-field operations. Use DataSet methods.

Syntax

long ObjPropertyRemove(long saveMode, string propertyName, string objSymbol, string objectKey, string rowkey, string keycol)

Parameters

Parameter Description
saveMode Use 1 or 0 as the placeholder.
Note: This parameter exists only for backward compatibility with older versions and has no function.
propertyName The name of the field to clear.
Note: Follow the same steps described for ObjProperty to derive the propertyName of the attribute
.
objSymbol

The symbol of the object.

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

The key of the object.

Note: You can use empty quotation marks ("") for the current workflow symbol.
rowKey The key (field name) for the row where the value exists in table data.
keycol Required when a rowKey is specified for the desired field.
Note: Refer to the ObjProperty definitions for identifying the keyCol.
Note: 
  • The ObjPropertySet, ObjPropertyRemove can only be used to clear a specific cell in an existing table.
  • It cannot be used to remove a row from a table. See Dataset Objects to remove table rows.

Return Value

The application returns a value greater than 0 if the operation is successful.

Impacts

  • The field value in the database immediately is removed.
  • The changes are persisted and visible to all users.

Prerequisites

  • The function cannot remove entire rows from tables. The function only clears cell values.
  • The row must exist when clearing table cells.
  • The key column must correctly identify the target row.

Examples

Example 1
Clear the Mfg. Item from the current formula:
ObjPropertyRemove(0, "ITEMCODE", "FORMULA", "");
Example 2
Clear the Sodium parameter value on Formula REPL\0001:
ObjPropertyRemove(0,  "VALUE.TPALL", "FORMULA", "REPL\0001", "SODIUM", "PARAM_CODE");
Example 3
Clear the Target value on the current Specification for the “DEFECTS” parameter:
ObjPropertyRemove(0, "TARGET.TP", "", "", "DEFECTS", "PARAM_CODE");
Example 4
Clear the reference status for the vendor ACME on the current item:
ObjPropertyRemove(0, "REFSTATUS.REF.V\REFITEM1", "", "", "ACME", "OBJECTCODE");
Example 5
Clear the value in the 4th column of the Project extension table with View ID = 2, on line 5:
ObjPropertyRemove(0, "FIELD4.MATRIX.V\DMPROJECT2", "", "", "5", "LINE_ID");