RemoveContextAttrib

You can use this function for Optiva Workflows and Copy Methods.

Purpose

The function RemoveContextAttrib removes an Optiva object from one or all context attributes.

Syntax


long RemoveContextAttrib(string objSymbol, string objkey, string AttribName, params string[] @params)

Return Values

If the code is successful, the function displays a value greater than zero (0) if context(s) is/are removed successfully.

Arguments

Part Description
objSymbol The object type or current object type of the data.
Note: Use empty quotation marks to indicate the current symbol of the workflow.
Objkey The object key or the current object key of the data.
Note: Use empty quotation marks to indicate the current object of the workflow.
AttribName

The name of attribute assigned to the context.

You can use these codes:

  • C_BRAND - brand
  • C_PRODTYPE - product type
  • SELLOC - selling location
  • MFGLOC - manufacturing location
  • C_ENDUSE - end use
  • C_ENDUSER - end user
param1, param2

The attributes that are to be removed from the object.

Note: Use empty quotation marks to remove all the attributes.

Description

Use this function to delete the context attribute values from an object.

Examples

This example removes ACME and GENERIC as brands for the PIZZASAUCE\003 formula.


Dim lRemovebrand As Long = RemoveContextAttrib("FORMULA", 
"PIZZASAUCE\003","C_BRAND","ACME","GENERIC")

This example removes all selling location attributes from the workflow or new object.


Dim lRemovelocation As Long = RemoveContextAttrib("","", "SELLOC","")

This example checks if the workflow’s object belongs to the FROZEN set code. If so, the FRESH product type attribute is removed from the object.


Dim lSet As Long = HasSetCodes("","","FROZEN")
if (lSet = 1) then
   Dim lRemoveproduct As Long
   RemoveContextAttrib("","","C_PRODTYPE", "FRESH")
end if

This example removes the context attributes ACME and GENERIC from the C_BRAND (brand) attribute type for the formula object "PIZZASAUCE\003"

RemoveContextAttrib("FORMULA", "PIZZASAUCE\003", "C_BRAND", "ACME", "GENERIC");