CopyRefObjSetCodes
You can use the CopyRefObjSetCodes function to add the primary objects set codes to the set codes of the reference object, but these set codes must exist and be configured for the new object type.
When to use
You can use this function when:
- Implementing copy methods for objects created from the References tab.
- The new objects must inherit the same classification or categorization as the parent.
When not to use
You cannot use this function when:
- The matching set codes are not configured for the target object type.
- Outside of copy method workflows (function requires specific context setup).
Syntax
long CopyRefObjSetCodes();
Parameters
This function does not have parameters. It uses the current copy operation context to identify:
- The reference (parent) object from which to copy set codes.
- The target (new) object to which the set codes will be assigned.
Return Value
The application returns a value greater than zero (0) if the operation is successful.
Prerequisites
- The set codes that exist for both object types are copied.
- The user must have permissions to assign set codes to the target object.
Examples
CopyRefObjSetCodes();
- Description
-
This script is in a copy method for a specification that is created from the References tab of a formula (Object Type = SPECIFICATION, Reference Type = FORMULA, Events = Create From As New). It copies all of the set codes from the formula to the specification.