This chapter covers the following topics:
Default 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 predefined default rules that mirror the behavior of the application when default values are hard coded. However, you have the flexibility to disable the predefined rules and add your own.
You can enable default rules by setting the ASO: Enable Defaulting Rule profile to Yes. See Profile Options for Displaying Default Values for more details.
The following sections explain some terms that are part of the default rules setup.
Default rules automatically display values into fields in a quote (both header and line). You can define the rules and the sequence in which the display of values into fields must take place. You can also define the trigger and dependant fields.
You can set up default 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 represent specific flows in Oracle Quoting where default rules are used. The entities in Quoting are Quote Header, Quote Line, and Quote Opportunity.
Quote Header
Applicable to Create Standalone Quote and Update Quote (all quotes) flows
Quote Line
Applicable to Create Standalone Quote and Update Quote (all quotes) flows
Quote Opportunity
Applicable only to Create Quote from Opportunity flow
Default condition templates act like top-level filters based on which the corresponding default rules are executed. Entities are the conditions for the filters. Each entity has attributes. Default 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 are individual fields in the quote. Default rules are created for some of the quote attributes. The default rule indicates what the default value for the attribute should be and the source from where it should be derived. Based on the default condition, the corresponding default rule is chosen for the attribute.
The source types provide default values for the quote attributes. The following are the predefined source types for Oracle Quoting.
Source Type | Meaning |
---|---|
Same Record | Using 'Same Record' as a source type, you can provide a default value of an attribute from another attribute on the same entity record. For example-
|
System Variable | This system variable source option enables you to provide system variables or functions of system variables for a field by default. This may be used to provide default values for date fields where SYSDATE expression or functions on SYSDATE are used to provide default value for 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 value to be the same value or to be used if none of the other sources for the default rule can provide a value. |
Profile Option | This enables you to use a profile option, either system or user-defined, as a default value source. |
PL/SQL API | This source type enables you to set up a complex default 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 default rule setup. See Predefined 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. |
Sequencing is the order in which the default rules are applied. Each attribute is associated with a value which determines its sequence.
A trigger attribute has one or more dependent attributes that must be displayed when the trigger attribute's value is changed. A dependent attribute must be cleared and displayed by default if the corresponding trigger attribute is changed. For example, a default 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 through 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.
The tables below indicate the predefined 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.
Trigger Attribute | Dependent Attribute | Predefined Value for Dependency Enabled (Yes or 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 Billing Customer Name Billing Customer Account Freight Terms Price List |
No Yes No No No Yes |
Customer Name of quote | Contact Name Address Phone Billing Customer Name Billing Account Number Billing Contact Name Billing Address Shipping Customer Name Shipping Account Number Shipping Contact Name Shipping Address End Customer Name End Customer Account Number End Customer Contact Name End Customer Address Automatic Pricing Automatic Tax |
No Yes Yes Yes Yes No Yes Yes Yes No Yes No No No No No No |
Customer Account of a quote | Price List FOB Freight Terms Requested Date Type |
Yes No No Yes |
Billing Customer Account | Price List FOB Freight Terms Payment Terms Primary Salesperson Shipping Method Order Type |
No No No No No No No |
Billing Address (Party Site) - If Billing 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 |
Trigger Attribute | Dependent Attribute | Predefined Value for Dependency Enabled (Yes or 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 Billing Customer Name Billing Customer Account Freight Terms Price List |
No No No No No Yes |
Billing Customer Account | Price List FOB Freight Terms Payment Terms Shipping Method |
No No No No No |
Billing Address (Party Site) - If Billing 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 predefined dependencies, you must run the Order Capture Dependency concurrent program. See Order Capture Dependency Generator concurrent program for more details.
Here are some scenarios where default rules can be setup. You can also set up business rules that are specific to one or more operating units.
Provide a default value for the Price List attribute at the header level based on the value of billing Customer Name.
Provide a default value for the Primary Salesperson based on the Customer Name of the quote.
Change the logic for deriving the default value of expiration date. Instead of using the profile, define the new logic in a PL/SQL API. The PL/SQL API is the source for displaying the default value in the expiration date field. See Predefined API Signature for the PL/SQL Source Type for the predefined PL/SQL API source type signature.
Some notes about default rules:
The price list default values is not filtered by currency. After the price list default value is displayed, if the new price list and existing currency combination is not valid or no conversion exists for it, then the price list is cleared.
Oracle Quoting does not preserve an existing value for a field if the default rule does not come up with a value for it.
If Terms Substitution modifiers have been setup, the values in the Payment Terms, Freight Terms, and Shipping Method fields, automatically displayed based on default rules, may be overridden after the pricing call.
Default rules are not applicable for creating and updating quote templates.
Quote line default rules for model components must take into account the nature of top model and parent model (ATO, PTO, Ship Model Complete PTO). For instance, you should not set up a quote line default rule to display by default different Shipping Methods for the components of an ATO model.
You cannot use default rules for the following quote header attributes:
Customer Name
The Customer Name of quote in the Opportunity to Quote flow is obtained by default from the Opportunity and cannot be changed.
Opportunity Name
The Opportunity Name in the Opportunity to Quote flow is obtained by default from the Opportunity and cannot be changed.
Account Number
The Account Number of a quote in the Create Quote flow (standalone quote) does not use the default rules framework.
Sales Supplement
The Sales Supplement field does not use the default rules framework.
Status
The Status values of a quote are based on the transition rules set up in Quoting windows. The default rules framework is not used for this field.
Use the following pointers to create default rules.
Steps
Log in to Oracle Quoting windows with the Quoting Sales Manager responsibility and select Defaulting Rules from the Setup functions.
Query for Order Capture in the Application field.
Choose from any of these entities: Quote Header, Quote Line, and Quote Oppty.
Refer the Order Management Implementation Manual for detailed steps on creating default rules.
Some dependencies are predefined for default rules in the application. See Predefined Mapping Between Trigger and Dependent Attributes for more details Use this procedure to change the predefined dependency.
Steps
Log in to the Linux or UNIX server with appropriate permissions.
Make a copy of the asodepmp.sql file located in the $ASO_TOP/patch/115/sql/ folder.
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.
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';
Save your changes and run the script asodepmp.sql with the apps user responsibility.
Log in to Oracle Windows with the Quoting Sales Manager responsibility.
Run the Order Capture Dependency Generator and Defaulting Generator concurrent programs. See Concurrent Programs in Default Rules for more details.
There are two concurrent programs that affect the functioning of default 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:
To generate default rules for the first time or update existing default rules or conditions that are default, you must submit the Defaulting Generator concurrent program. New or modified rules and conditions are not effective until the program is successfully run.
Note: Predefined default rules can be disabled, but not modified. If you wish to modify a predefined default rule, disable the predefined default rule condition, and then create a copy of the predefined default rule and include your changes in the copied default rule.
The concurrent program must be submitted if you perform either of the following:
Add or update a default rule
Enable or disable a default rule
Add or update a default condition template
Enable or disable a default condition template
Notes
Log in to Oracle Windows with the Quoting Sales Manager responsibility and navigate to the Concurrent Requests window from the View menu, then select Requests menu.
Application
Select Order Capture.
Entity
Select either Quote Header, Quote Line or Quote Oppty depending on which entity you have modified.
Attribute
Select an attribute from the list.
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:
Disable a dependency between two attributes
Enable a dependency between two attributes
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
Log in to Oracle Windows with the Quoting Sales Manager responsibility and navigate to the Concurrent Requests window from the View menu, then select Requests menu.
Database Object Name
Select either Quote Header ( ASO_AK_QUOTE_HEADER_V ) or Quote Line ( ASO_AK_QUOTE_LINE_V )
Primary Key Column Name
Select Q_QUOTE_HEADER_ID if you choose Quote Header as the Database Object Name or L_QUOTE_LINE_ID if you choose Quote Line as the Database Object Name.
Last Update Date Column Name
Select Q_LAST_UPDATE_DATE if you choose Quote Header as the Database Object Name or L_LAST_UPDATE_DATE if you choose Quote Line as the Database Object Name.
You can create a custom API for the PL/SQL API source type. Here is the signature of the predefined 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.
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 display the default value of 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 default 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