Generate Numbers and Descriptions with Rules

The following scenarios illustrate how to use rules to generate numbers for newly created items, change orders, or new item requests, and descriptions for newly created items.

  • Creating rules to generate numbers for new items

  • Creating rules to generate descriptions for new items

  • Creating rules to generate numbers for change orders

  • Creating rules to generate numbers for new item requests

Creating Rules to Generate Numbers for New Items

This scenario illustrates how to use rules to generate numbers for newly created items.

  1. Select the Setup Rules task.

  2. On the Manage Rule Sets page, create and save a rule set with the field values shown in the following table.

    Field (in Rule Set)

    Value

    Display Name

    Example: MyItemNumGenRuleSet1

    Type

    Assignments

    Association Type

    Item Class

    Association Name

    Example: MyItemClass1

    Business Entities

    One or more of Item data level, Item revision data level, or Item supplier data level

  3. On the Edit Rule Set page, create and save a rule with the field values shown in the following table.

    Field (in Rule)

    Value

    Name

    Example: MyItemNumGenRule1

    Return Type

    Item Number

    Primary If Expression

    true

    Secondary If Expression

    true

    Return Value

    Example:

    [Item].[Physical Attributes].[Unit Length]
  4. Select the Manage Item Classes task.

  5. On the Manage Item Classes page, edit the item class that you selected as the association name for your rule set.

  6. On the Item Management tab of the Edit Item Class page, select the field values shown in the following table, and save the item class.

    Field (in Item Class)

    Value

    Name

    Example: MyItemClass1

    Item Number Generation Method (in the Number Generation section)

    Rule Generated

    Associated Rule Set

    Example: MyItemNumGenRuleSet1

    Note: Only rule sets with the corresponding association type (in this scenario, Item Class) are available. Also, your rule set won't appear in the Associated Rule Set list of values unless a valid rule has been created in the rule set.
  7. When you create a new item from this item class, the item number field initially contains a message that the number will be rule generated. When you save (or submit) the item, your rule generates a number for it.

    Note: Once an item has been saved, its item number, whether generated or manually entered, can't be changed unless the Update Item Number (EGP_UPDATEABLE_ITEM) profile option has been set to Yes at the site level. If that profile option has been set to Yes, then when any attributes used in your number generation rules are updated, the item numbers are regenerated accordingly.

Creating Rules to Generate Descriptions for New Items

This scenario illustrates how to use rules to generate descriptions for newly created items The scenario is the same as the one for generating numbers for new items, with the differences shown as follows.

  • In the Details section of the Edit Rule Set page, the differences for your rule are shown in the following table.

    Field (in Rule)

    Value

    Name

    Example: MyItemDescGenRule1

    Return Type

    Item Description

    Return Value

    Example:

    [Item].[Main].[Item_Type] + [Item].[Main].[Long_Description]

  • On the Item Management tab, the differences for your item class are shown in the following table.

    Field (in Item Class)

    Value

    Item Description Generation Method (in the Description Generation section)

    Rule Generated

    Associated Rule Set

    Example: MyItemDescGenRule1

  • When you create a new item from this item class, the item Description field initially contains a message that the description will be rule generated. When you save (or submit) the item, your rule generates a read-only description for it.

  • Whenever any attributes used in your description generation rules are updated, the item descriptions are regenerated accordingly when the item is displayed.

Note: The same rule set can contain rules for both item number generation and item description generation.

Creating Rules to Generate Numbers for Change Orders

This scenario illustrates how to use rules to generate change order numbers for newly created change orders. The scenario is the same as the one for generating numbers for new items, with the differences shown as follows.

  • On the Edit Rule Set page, the differences for your rule set are shown in the following table.

    Field (in Rule Set)

    Value

    Display Name

    Example: MyCONumGenRuleSet1

    Association Type

    Change type

    Association Name

    Example: MyCOType1

  • In the Details section of the Edit Rule Set page, the differences for your rule are shown in the following table.

    Field (in Rule)

    Value

    Name

    Example: MyCONumGenRule1

    Return Type

    Change order number

    Return Value

    Example:

    Flexfield[CM_Global_Segment1]
  • On the Number Generation tab of the Edit Change Order Type page, the differences for your change type are shown in the following table.

    Field (in Change Type)

    Value

    Number Generation Method (in the Number Generation section)

    Rule Generated

    Associated Rule Set

    Example: MyCONumGenRuleSet1

  • When you create a new change order, your rule generates a change order number for it after you submit it.

Creating Rules to Generate Numbers for New Item Requests

This scenario illustrates how to use rules to generate new item request numbers for newly created new item requests. The scenario is the same as the one for generating numbers for new items, with the differences shown as follows:

  • On the Edit Rule Set page, the differences for your rule set are shown in the following table.

    Field (in Rule Set)

    Value

    Display Name

    Example: MyNIRNumGenRuleSet1

    Association Type

    New Item Request

    Association Name

    Example: MyNIRType1

  • In the Details section of the Edit Rule Set page, the differences for your rule are shown in the following table.

    Field (in Rule)

    Value

    Name

    Example: MyNIRNumGenRule1

    Return Type

    Return Value

    Example:

    Flexfield[CM_Global_Segment1]
  • On the Number Generation tab of the Manage New Item Request Type Details page, the differences for your new item request type are shown in the following table.

    Note: There are multiple item classes and change types, but only a single type for new item requests. Consequently, all new item requests use the same rule set.

    Field (in New Item Request Type)

    Value

    Number Generation Method (in the Number Generation section)

    Rule Generated

    Associated Rule Set

    Example: MyNIRNumGenRuleSet1

  • When you create a new item request, your rule generates a new item request number for it.