Object Type Bind

Business rules can use the Object Type bind to access the selected object types.

The bind can be found within the 'Binds to' dropdown, as shown below.

Although the 'Select Objecttype' dialog includes all object types from the 'Object Types & Structures' node, selecting user-defined object types (product, entity, asset, and classification) is the most common use for this bind.

Configuration

To use any bind:

  1. Create a business rule as defined in the Creating a Business Rule, Function, or Library topic.

  2. Edit the business rule as defined in the Editing a Business Rule or Function topic.

  3. In the Edit Operation dialog, add the bind to a business rule, as defined in the Adding a Bind topic in the Resource Materials online help documentation.

  4. In the Edit Operation dialog, optionally add Messages, as defined in the Localized Messages for JavaScript Business Rules topic.

  5. In the Edit Operation dialog, add JavaScript to call the bind.

Example

The following is an example JavaScript that uses this bind.

Important: Example scripts should not be used as-is without thorough testing, including updating the script to match object and link types that exist on your system. JavaScript variable names are case-sensitive.

The sample code uses binds to Logger, Current Object, and Object Type. When the 'SalesItem' object type uses auto IDs (via the Object type 'ID pattern' parameter set to [id]), the operation creates a 'SalesItem' object as a child to the current object being evaluated by the business rule.

Copy
// This requires that auto IDs are configured 
// for the Sales Item object type
var salesItem = parent.createProduct("", salesItemObjectType);