Setting Up Defaulting Rules

This chapter covers the following topics:

Overview of Defaulting Rules

Defaulting rules enable you to create and update quotes easily. Based on the setup, appropriate fields in the quote are automatically filled in. Oracle Quoting has seeded defaulting rules that mirror the behavior of the application when defaulting was hard coded. However, you have the flexibility to disable the seeded rules and add your own.

You can enable defaulting rules by setting the ASO: Enable Defaulting Rule profile to Yes. See Profile Options for Defaulting for more details.

The following sections explain some terms that are part of the defaulting rules setup.

Defaulting Rules

Defaulting rules populate values into fields in a quote (both header and line). You can define the rules and the sequence in which the defaulting must take place. You can also define the trigger and dependant fields.

You can set up defaulting rules such that most of the mandatory and business rules-centric fields are taken care of. By doing so, you can focus on other aspects of the quote.

Entities

Entities represent specific flows in Oracle Quoting when defaulting should occur. The entities in Quoting are Quote Header, Quote Line, and Quote Oppty.

Defaulting Condition Templates

Defaulting condition templates act like top-level filters based on which the corresponding defaulting rules are executed. Entities are the conditions for the filters. Each entity has attributes. Defaulting rules are applicable to these attributes within an entity.

For example, Payment Type and Customer are entities. The attributes for these entities are Credit card and Business World respectively. Always is a generic condition.

Attributes

Attributes are individual fields in the quote. Defaulting rules are created for some of the quote attributes. The defaulting rule indicates what the default value for the attribute should be and the source from where it should be derived. Based on the defaulting condition, the corresponding defaulting rule is chosen for the attribute.

Source Types

The source types provide default values for the quote attributes. The following are the seeded source types for Oracle Quoting.

Seeded Source Types for Defaulting
Source Type Meaning
Same Record Using ‘Same Record’ as a source type, you can default an attribute from another attribute on the same entity record. For example-
  • The Quote To Customer, Account can be used as a source for defaulting the Bill To Customer, Account.

  • The Expiration Date can be used as a source for defaulting the Pricing Date.

System Variable This system variable source option enables you to default system variables or functions of system variables for a field. This may be used to default date fields where SYSDATE expression or functions on SYSDATE can be used to default the current date or a function of the current date. For example, you can set up the quote expiration date to be SYSDATE+30.
Constant Value This source type enables you to specify a constant value instead of a field that contains a value. This will be useful if you want the default to be the same value or to be used if none of the other sources for the defaulting rule can provide a value.
Profile Option This allows you to use a profile option, either system or user-defined, as a default value source.
PL/SQL API This source type allows you to set up a complex defaulting rule that cannot be defined with the other source types listed above. The logic to derive the default value is coded into a PL/SQL API. The API name is referenced within the defaulting rule setup. See Seeded API Signature for PL/SQL for more information.
Related Record The related record can derive values from the corresponding field in the Quote Header.

Important: This source type is applicable only for line-level attributes.

Web Applications Dictionary-Attribute and Web Applications Dictionary - Object Attribute

Important: Both these source types are not supported in Oracle Quoting.

Sequencing in Defaulting Rules

Sequencing is the order in which the defaulting rules will be applied. Each attribute is associated with a value which determines its sequence.

Trigger and Dependent Attributes

A trigger attribute has one or more dependent attributes that must be defaulted into when the trigger attribute's value is changed. A dependent attribute must be cleared and defaulted if the corresponding trigger attribute is changed. For example, a defaulting rule can be defined to derive a value for the payment terms and price list attributes if the pricing agreement is changed. In this example, the pricing agreement is the trigger attribute and the payment terms and price list are dependent attributes.

In Oracle Quoting, you can enable dependencies via the Dependency Enabled flag. While setting up trigger and dependent attributes, it is important not to setup cyclical dependencies. Thus, if trigger attribute A has dependent attributes B, C, D and trigger attribute C has dependent attribute A, then there is a cyclical dependency for attribute A. This type of cyclic dependency should be avoided.

Seeded Mapping Between Trigger and Dependent Attributes

The tables below indicate the seeded mapping between the trigger and the dependent attributes. The current dependencies are enabled by setting the Dependency Enabled flag. You may disable a dependency between the trigger and dependent attributes by setting this flag to No.

Seeded Mapping Between Trigger and Dependent Attributes (Quote Header)
Trigger Attribute Dependent Attribute Seeded Value for Dependency Enabled (Yes/No)
Operating Unit Order Type
Price List
Primary Salesperson
Contract Template
Shipping Method
Yes
Yes
Yes
Yes
Yes
Order Type Price List
Shipping Priority
Shipping Method
FOB
Demand Class
Freight Terms
Yes
No
No
No
No
No
Pricing Agreement PO Number
Payment Terms
Bill to Customer
Bill to Customer Account
Freight Terms
Price List
No
Yes
No
No
No
Yes
Quote to Customer Quote to Contact
Quote to Address
Quote to Phone
Bill to Customer
Bill to Customer Account
Bill to Contact
Bill to Address
Ship to Customer
Ship to Customer Account
Ship to Contact
Ship to Address
End Customer
End Customer Account
End Customer Contact
End Customer Address
Automatic Pricing
Automatic Tax
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
No
No
No
No
No
No
Quote to Customer Account Price List
FOB
Freight Terms
Requested Date Type
Yes
No
No
Yes
Bill to Customer Account Price List
FOB
Freight Terms
Payment Terms
Primary Salesperson
Shipping Method
Order Type
No
No
No
No
No
No
No
Bill to Address (Party Site) - If Bill to Customer Account is specified Price List
FOB
Demand Class
Freight Terms
Payment Terms
Primary Salesperson
Shipping Method
Order Type
No
No
No
No
No
No
No
No
Ship to Customer Account Price List
FOB
Freight Terms
Payment Terms
Primary Salesperson
Shipping Method
Order Type
No
No
No
No
No
No
No
Ship to Address (Party Site) - If Ship to Customer Account is specified) Price List
FOB
Demand Class
Freight Terms
Payment Terms
Primary Salesperson
Shipping Method
Order Type
No
No
No
No
No
No
No
No
Price List Payment Terms
Freight Terms
Shipping Method
No
No
No
Primary Salesperson Primary Salesgroup Yes
Seeded Mapping Between Trigger and Dependent Attributes (Quote Line)
Trigger Attribute Dependent Attribute Seeded Value for Dependency Enabled (Yes/No)
Line Type Price List
Shipment Priority
FOB
Demand Class
Freight Terms
Warehouse
No
No
No
No
No
No
Pricing Agreement PO Number
Payment Terms
Bill to Customer
Bill to Customer Account
Freight Terms
Price List
No
No
No
No
No
Yes
Bill to Customer Account Price List
FOB
Freight Terms
Payment Terms
Shipping Method
No
No
No
No
No
Bill to Address (Party Site) - If Bill to Customer Account is specified) Price List
FOB
Demand Class
Freight Terms
Payment Terms
Shipping Method
No
No
No
No
No
No
Ship to Customer Account Price List
FOB
Freight Terms
Payment Terms
Shipping Method
No
No
No
No
No
Ship to Address (Party Site) - If Ship to Customer Account is specified) Price List
FOB
Demand Class
Freight Terms
Payment Terms
Shipping Method
No
No
No
No
No
No
Price List Payment Terms
Freight Terms
Shipping Method
No
No
No

If you change the seeded dependencies, you must run the Order Capture Dependency concurrent program. See Order Capture Dependency Generator concurrent program for more details.

User Scenarios for Defaulting Rules

Here are some scenarios where defaulting rules can be setup. You can also set up business rules that are specific to one or more operating units.

Notes about Defaulting Rules

Some notes about defaulting rules:

Creating Defaulting Rules

Use the following pointers to create defaulting rules.

Steps

  1. Log in to Oracle Quoting Forms with the Quoting Sales Manager responsibility and select Defaulting Rules from the Setup functions.

  2. Query for Order Capture in the Application field.

  3. Choose from any of these entities: Quote Header, Quote Line, and Quote Oppty.

Refer the Order Management Implementation Manual for detailed steps on creating defaulting rules.

Changing the Seeded Dependency in Defaulting Rules

Some dependencies are seeded for defaulting rules in the application. See Seeded Mapping Between Trigger and Dependent Attributes for more details Use this procedure to change the seeded dependency.

Steps

  1. Login to the Linux/Unix server with appropriate permissions.

  2. Make a copy of the asodepmp.sql file located in the $ASO_TOP/patch/115/sql/ folder.

  3. Open the file (copy) and search for the line that has the trigger attribute name followed by the dependent attribute name on the following line.

  4. Change the value of the Enabled_Flag from N to Y.

    This example enables the dependency between Order Type (trigger attribute) and Shipment Priority code (dependent attribute).

    l_Dep_Rec(l_count).Trigger_Attribute_Name := 'Q_ORDER_TYPE_ID';
     l_Dep_Rec(l_count).Dependent_Attribute_Name := 'Q_SHIPMENT_PRIORITY_CODE';
     l_Dep_Rec(l_count).Enabled_Flag := 'Y';
    
  5. Save your changes and run the modified asodepmp.sql script with the apps user responsibility.

  6. Login to Oracle Forms with the Quoting Sales Manager responsibility.

  7. Create a defaulting rule for the dependent attribute in Step 4 above. If a defaulting rule already exists and is enabled, you can skip this step. For information on creating defaulting rules, see Creating Defaulting Rules.

  8. Run the Order Capture Dependency Generator and Defaulting Generator concurrent programs. See Concurrent Programs in Defaulting Rules for more details.

Concurrent Programs in Defaulting Rules

There are two concurrent programs that affect the functioning of defaulting rules in Oracle Quoting. If you add a rule and change the dependency, it is recommended that the concurrent programs run in the following sequence:

Defaulting Generator Concurrent Program

To generate defaulting rules for the first time or update existing defaulting rules or defaulting conditions, you must submit the Defaulting Generator concurrent program. New or modified rules and conditions are not effective until the program is successfully run.

Note: Seeded defaulting rules can be disabled, but not modified. If you wish to modify a seeded defaulting rule, disable the seeded defaulting rule condition, and then create a copy of the seeded defaulting rule and include your changes in the copied defaulting rule.

The concurrent program must be submitted if you perform either of the following:

Notes

Order Capture Dependency Generator Concurrent Program

This concurrent program updates the dependencies between Quoting Attributes. If you modify attribute dependencies, they are not effective until this concurrent program is successfully executed. The concurrent program must be executed if you perform any of the following:

If you modify the dependency between two Quote Header level attributes, run this concurrent program for the Quote Header. If you modify the dependency between two Quote Line level attributes, run this concurrent program for the Quote Line.

Notes

Seeded API Signature for the PL/SQL Source Type

You can create a custom API for the PL/SQL API source type. Here is the signature of the seeded PL/SQL API:

<API Name>
( p_database_object_name in VARCHAR2,
  p_attribute_code              in  VARCHAR2 )
return <datatype>
where the <datatype> can be NUMBER or VARCHAR2.

The table below describes Quoting entities, their associated entity code, and the database object that is called when the entity is processed within a Quoting transaction.

Processing Entities in a Quoting Transaction
Entity Entity Code Database Object
Quote Header QUOTE_HEADER ASO_AK_QUOTE_HEADER_V
Quote Line QUOTE_LINE ASO_AK_QUOTE_LINE_V
Quote Oppty QUOTE_OPPTY ASO_AK_QUOTE_OPPTY_V

Here is the sample code to default the Currency Code from the Quote Price List in a standalone quote or from the Price List in the Create Quote from Opportunity page:

FUNCTION Get_Currency_from_pricelist(
             P_Database_Object_Name    IN   VARCHAR2,
             P_Attribute_Code          IN   VARCHAR2
             ) RETURN VARCHAR2 
is
     Cursor C_currency_code(q_price_list_id Number) is
     SELECT currency_code
     FROM qp_price_lists_v
     WHERE price_list_id = q_price_list_id;
     l_price_list_id     Number;
     l_currency_code     C_currency_code%rowtype;
Begin
  -- Getting the defaulting global record based on the Database object name

     IF p_database_object_name = 'ASO_AK_QUOTE_HEADER_V' THEN
          l_price_list_id := ASO_QUOTE_HEADER_DEF_HDLR.g_record.q_price_list_id;
     ELSIF p_database_object_name = 'ASO_AK_QUOTE_OPPTY_V' THEN
          l_price_list_id := ASO_QUOTE_OPPTY_DEF_HDLR.g_record.o_price_list_id;
     END IF;

     -- Getting the Currency Code based on the Price List

     open C_currency_code(l_price_list_id);
     fetch C_currency_code into l_currency_code;
     close C_Currency_code;

     -- Returning the Currency Code

     RETURN l_currency_code.currency_code;
EXCEPTION
     -- Exception Handling
     WHEN NO_DATA_FOUND THEN
          RETURN NULL;
    WHEN OTHERS THEN
     IF OE_MSG_PUB.Check_Msg_Level (OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
     THEN
         OE_MSG_PUB.Add_Exc_Msg
         (     G_PKG_NAME         ,
             ' Get_Currency_from_pricelist '
         );
     END IF;
     RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
End Get_Currency_from_pricelist