Item Rule Expressions with Business Entities

Item rules refer to attributes through references that include the business entity that includes the attribute.

Supported Business Entities

When you reference an attribute in rule expressions, specify the business entity as the first term in the expression, as shown in the following examples:

Syntax:

[entity name].[attribute group name].[attribute]

Example:

[Item].[Main].[Item Status]

The business entities supported for use in item rules are listed in the following table:

Entity

For assignment rules

For validation rules

Cross Reference

No

Yes

GTIN

No

Yes

Item

Yes

Yes

Related Item

No

Yes

Revision

Yes

Yes

Structure

No

Yes

Style Item

No

Yes

Supplier

Yes

Yes

Cross-Entity References

You can reference attributes from certain other entities while creating rules for an attribute belonging to an entity.

For instance, you can create a validation constraint for a supplier-level attribute that references an item-level attribute, as summarized in the following example:

Field

Value

Severity

Reject

IF Expression

[Supplier].[Promotion Attributes].[Discount] >= 20%

Validation Condition

[Item].[Price Attributes].[MSRP] > 10$

The following example summarizes another validation rule that references attributes from different entities, namely the item and cross-reference relationship entities:

Field

Value

Severity

Warning

IF Expression

[Item].[Item_Basic].[ITEM_CLASS]== "Electronics" 
AND 
[CrossReference].[CrossReferenceMain].[Type]== "Old_Part_Number"

Validation Condition

!isnull([CrossReference].[CrossReferenceMain].[Value])

Using GTIN Entities

You can reference GTIN (Global Trade Identification Number) attributes to enforce your own business validations with regard to GTIN association.

Based on the specified criteria involving attributes or organizations, GTIN validation rules can check whether a GTIN is associated to an item, or check whether there was any change in the associated GTIN.

GTIN rules can also validate the digits of an item's GTIN. You can use a rule to validate that the Packaging Indicator digit for a GTIN is appropriate for the Pack Type of the item. GTINs can be assigned at multiple levels of a packaging hierarchy. Consider a scenario in which your GTIN numbering rule declares that, if the pack type of the Item is "Case", then the fourth digit of the GTIN should be 8. The following example summarizes a validation rule that references attributes for Item and GTIN entities.

Field

Value

Severity

Warning

IF Expression

[Item].[Main].[Pack Type] == "Case"

Validation Condition

subString([GTIN].[GTIN Main].[GTIN],4,4)=="8"

Using Style Item Entities

You can use the Style Item entity to access the attributes of the corresponding style item of SKU items.

If a rule contains a Style Item entity then the rule will only be run if:

  • The user modified a style item.

  • The user created or modified a SKU item.

  • The user created or modified an entity (such as a revision, or supplier association) on a SKU item and the rule also uses that entity.

The following example summarizes an assignment rule that references attributes from the Style Item entity:

Field

Value

Return type

Item Description

Primary If Expression

true

Secondary If Expression

true

Return Value

[StyleItem].[Main].[Item Description] + ", " + [Item].[Top Variants].[Color] + ", " + [Item].[Top Variants].[Top Size]