Set Warehouse According to the Value of Some Other Attribute

Set up Order Management so it sets the default value for the Warehouse attribute on the fulfillment line according to the value of the Business Unit attribute on the order header.

Assume the Vision Operations business unit sells desktop computer systems, and it uses the same warehouse to build them. It uses the M5 Denver Manufacturing warehouse to fulfill all of its sales orders.

Summary of the Setup

  1. Get values for your attributes.

  2. Create a posttransformation rule.

  3. Test your setup.

Get Values for Your Attributes

  1. Get the ID for the business unit.

    • Do an SQL.

      SELECT haotl.NAME BU_NAME,
        hao.organization_id
      FROM
        fusion.HR_ALL_ORGANIZATION_UNITS_F hao,
        fusion.HR_ORGANIZATION_UNITS_F_TL haotl,
        fusion.HR_ORG_UNIT_CLASSIFICATIONS_F houc,
        fusion.hr_organization_information_f hoi
      WHERE
        hao.ORGANIZATION_ID = haotl.ORGANIZATION_ID
        AND houc.ORGANIZATION_ID = haotl.ORGANIZATION_ID
        AND houc.CLASSIFICATION_CODE = 'FUN_BUSINESS_UNIT'
        AND hoi.ORGANIZATION_ID = haotl.ORGANIZATION_ID
        AND hoi.ORG_INFORMATION_CONTEXT = houc.CLASSIFICATION_CODE
        AND TRUNC(SYSDATE) BETWEEN haotl.EFFECTIVE_START_DATE AND haotl.EFFECTIVE_END_DATE
        AND haotl.LANGUAGE = USERENV('LANG')
        AND haotl.EFFECTIVE_START_DATE = hao.EFFECTIVE_START_DATE
        AND haotl.EFFECTIVE_END_DATE = hao.EFFECTIVE_END_DATE
        AND upper(Haotl.name)LIKE '&BUSINESS_UNIT_NAME%'
      ORDER BY BU_NAME;

      For details, see Use SQL to Query Order Management Data.

    • In the query result, locate the row that contains Vision Operations in the BU_NAME column. Assume the query returns these values.

      BU_NAME

      ORGANIZATION_ID

      Vision Operations

      300000001616323

      Customer

      Computer Service and Rentals

  2. Get the ID for the warehouse.

    • Do an SQL.

      SELECT  
        haotl.NAME,
        iop.ORGANIZATION_CODE,
        iop.ORGANIZATION_ID
      FROM
        fusion.Inv_Org_Parameters iop,
        fusion.HR_ORGANIZATION_UNITS_F_TL haotl
      WHERE
        haotl.organization_id = iop.business_unit_id
        AND haotl.LANGUAGE = USERENV('LANG')
        AND upper(iop.ORGANIZATION_CODE) LIKE '&INVENTORY_CODE%'
      ORDER BY haotl.NAME,
    • In the query result, locate the row that contains M5 Denver Manufacturing in the ORGANIZATION_CODE column. Assume the query returns these values.

      ORGANIZATION_CODE

      ORGANIZATION_ID

      M5 Denver Manufacturing

      300000001621783

Create a Posttransformation Rule

add the Header.SourceOrderId is 300000001616323 test, then to the right of Header is a PosttransformationRules.HeaderVO, click Add Pattern.

Note

  • To create the And logic in the If area, add the Header.SourceOrderId is 300000001616323 test, then to the right of Header is a PosttransformationRules.HeaderVO, click Add Pattern.

  • At run time, if you create a sales order and set the Business Unit attribute on the order header to Vision Operations, then the posttransformation rule uses the Assign action that you specify to set the Warehouse attribute to M5 Denver Manufacturing.

Try it.

  1. Open another browser.

    Use two browsers. One for end-user tasks and the other for administrative tasks. This way, you can toggle back and forth during setup and testing.

  2. Go to the Setup and Maintenance work area, then go to the task.

    • Offering: Order Management

    • Functional Area: Orders

    • Task: Manage Posttransformation Defaulting Rules

  3. On the Manage Posttransformation Defaulting Rules page, create a new rule.

  4. In the If area, set the conditions.

    Code

    Description

    Header is a PosttransformationRules.HeaderVO

    Declare the Header variable into the PosttransformationRules dictionary.

    Get values for attributes of the order header that the orchestration process is currently processing from the header virtual object (VO), then store them in the Header variable.

    Header.SourceOrgId is 300000001616323

    Make sure the value of the SourceOrgId attribute on the order header contains 300000001616323.

    This value identifies the Vision Operations business unit that you identified when you ran the SQL.

    Order Management uses the SourceOrgId attribute to identify the business unit.

  5. In the Then area, add an Assign action.

    Code

    Description

    Header.FulfillOrgId = 300000001621783

    Order Management uses the FulfillOrgId attribute to identify the warehouse.

    This value identifies the M5 Denver Manufacturing warehouse that you identified when you ran the SQL.

  6. Click Save > Release.

    For details, see Overview of Using Business Rules With Order Management.

Test Your Setup

  1. Go back to your other browser and create a sales order.

    Attribute

    Value

    Business Unit

    Vision Operations

  2. Click Shipment Details > Supply, then verify that Order Management automatically set the value.

    Attribute

    Value

    Warehouse

    M5 Denver Manufacturing