CopyRefObjContextAttrib

You can use the CopyRefObjContextAttrib function to copy the context attributes from a reference object to a newly created object. This function is specifically designed for use in copy methods when creating objects from the References tab of another object.

When to use

You can use this function when:

  • Implementing copy methods for objects created from the References tab.
  • The new object must inherit context attributes from its parent or reference object.

When not to use

You cannot use this function when:

  • The context attributes are inherited from the parent or reference object.
  • The function is used outside a copy method workflow (function requires specific context setup).
  • The Create Rule event is not Create From or Create From as Reference.

Syntax

int CopyRefObjContextAttrib()

Return Value

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

Prerequisites

  • The function must be executed within a valid copy method workflow context.
  • The reference object must exist and be accessible.
  • Both the object must support context attributes.

Examples

long ingred = CopyRefObjIngreds();
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 adds all of the context attributes, with or without a value, to the specification.