Item Rule Multirow Attribute Group Functions

To reference a value in a particular row of a multirow attribute group, use one of the following functions.

To make a rule set specific to an item class, assign it to that item class during rule set creation. That rule set will then be active for each entity that has that item class as a parent or as an ancestor. You can't access any other attributes associated with an item class.

Tip: If you reference multiple multirow attribute groups in a rule, then, during execution, the rule loops though each combination of rows of all the groups. Example: a rule with the following If Expression that references the multirow attribute groups MR_AG1 and MR_AG2, where MR_AG1 has m number of rows and MR_AG2 has n number of rows:This rule is executed m*n times. You can reduce the number of executions to m+n by splitting the rule into two rules, to separate the references to the multirow attribute groups.

loopSum

Syntax:

loopSum([Entity name].[multirow Attribute Group Name].[Attribute Name])

The loopSum function takes one numeric sub-expression as an argument. It runs the sub-expression for each multirow row attribute group and compute the sum of the results.

Example

In this example, the sum of the values in all the rows of Percentage attribute can't be a value other than 100.

Severity: Reject
If Expression: (loopSum([Item].[Composition].[Percentage])) != 100

conditionalLoopSum

Syntax:

conditionalLoopSum(boolean_expression, [Entity name].[multirow AttributeGroupName].[Attribute Name])

The conditionalLoopSum function takes two sub-expression arguments. The first argument must be a boolean expression and the second argument will be a numeric sub-expression. The function runs the boolean sub-expression for each multirow row and, if the boolean evaluates to true, computes the numeric sub-expression for that row. The function returns the sum of the computed numeric expressions.

Example

In this example, assume a multirow attribute group named Forecast with the following rows.

Customer

Location

Required Quantity

ABC

Seattle

20

XYZ

Seattle

30

ABC

Boston

25

The following example will sum up the values of Required Quantity for which the corresponding Location is Seattle:

conditionalLoopSum([Item].[Forecast].[Location] == "Seattle", [Item].[Forecast].[Required Qty])

isMrRowDeleted

You can validate whether a row was deleted from a multirow extensible flexfield (EFF) attribute group using the isMrRowDeleted function in validation or assignment rules. For example, you can enforce change order approval when a row is deleted using the isMrRowDeleted function in a validation rule. You can use this function for multirow attribute group of items, item revisions, or supplier EFFs.

Syntax:

isMrRowDeleted(<Mutli_Row_EFF_Attribute_Group_Name>)

It returns true if a row was deleted for the multirow EFF group. Otherwise, it returns false.

Here's an example shows a validation rule expression using the isMrRowDeleted function.

isMRRowDeleted([Item].[Material Composition]) OR changed([Item].[Material Composition].[Percentage])

You can use the isMrRowDeleted function along with the changed function to validate modifications or delete operations on a multirow attribute.