RemoveSetCodes
You can use this function for Optiva Workflows and Copy Methods.
Purpose
The function RemoveSetCodes removes an Optiva object from one, several, or all set codes.Syntax
long RemoveSetCodes(string objSymbol, string objkey, params string[] @params)
Return Value
If the code is successful, a value greater than zero (0) is displayed.
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.
|
params |
The one or more set code from which you want to remove the object.
Note: Empty params indicates that all the set codes are removed.
|
Description
RemoveSetCodes removes a system object from a set. For example, a formula can be assigned to the FDA set, which indicates formulas with FDA approval. If a formula has to be retested under new guidelines, then run a workflow to remove the formula from the set.
A newly created object is automatically added to the set code for the lab. You cannot remove this set code.
Examples
This example removes the PIZZASAUCE\003 formula from the SUB set.
Dim lRemoveset As Long
RemoveSetCodes("FORMULA","PIZZASAUCE\003", "SUB")
The next example removes the workflow object or newly-created object from the TOP_COAT and SEALANT sets.
Dim lRemoveset As Long
RemoveSetCodes("","","TOP_COAT","SEALANT")
In this example, the script checks if the workflow object or newly-created object belongs to a program. If not, the script removes the object from all sets.
Dim oProgram As Object = ObjProperty("PROJECTCODE")
Dim iBlank As Integer = IsBlank(oProgram)
if (iBlank = 1) then
Dim lRemoveset As Long = RemoveSetCodes("","","")
end if
Example 1: Removes SUB set code for formula PIZZASAUCE\003
RemoveSetCodes("FORMULA", "PIZZASAUCE\003", "SUB");
Example 2: Removes all set codes for formula PIZZASAUCE\003
RemoveSetCodes("FORMULA", "PIZZASAUCE\003", "");