Attribute and Attribute Group Binds

The Attribute and Attribute Group binds allow access to the selected object. These binds are found under the 'Binds to' dropdown, as shown below.

Each bind is defined in the sections below.

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.

Note: 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

Attribute

The selected attribute is bound to the variable.

In this example, the Variable Name is 'eanAttribute', the Binds to field is Attribute, and the Parameters field displays the EAN attribute. The following JavaScript returns the ID of the EAN attribute as an Info log message:

Copy
var bindDemo = eanAttribute.getID();
log.info("Attribute ID is " + bindDemo);

Attribute Group

The selected attribute group is bound to the variable.

In this example, the Variable Name is 'displayAttrGroup', the Binds to field is Attribute Group, and the Parameters field shows the Display attribute. The following JavaScript returns the ID of the Display attribute group as an Info log message:

Copy
var bindDemo = displayAttrGroup.getID();
log.info("Attribute Group ID is " + bindDemo);