Overview
Order Management Defaulting Rules reduce
the amount of data input required when entering orders or returns. You can
define business rules for defaulting values, and prioritize how conditions and
validation rules are implemented. If a defaulting rule definition fails to
default desired values for orders or returns, you can choose to define
additional defaulting rules for most attributes (fields) within Entities such
as Order or Line.
Order Management provides seeded defaulting
rules, and you can create additional Defaulting Rules by either
- defining a new defaulting rule, either with a new Condition you
create or using an existing Condition.
- disabling a seeded defaulting rule and creating your own. You can
not change seeded defaulting rules but you can disable the defaulting
rule's condition.
Note: You cannot update
defaulting rules marked as seeded. However, you can create additional rules
based upon seeded rule definitions and consequently disable the seeded rule.
You can use defaulting rules to default
values into fields (attributes) in both the Header and Lines Entities
- Entities include groups of related attributes such as Order
or Line.
- Attributes are the individual fields within a particular entity,
such as Warehouse, Ship To Location, or Agreement.
A default is a value that Order Management
automatically places in an order or line field.
- If the Attribute name is the same on both the Order and the Line,
you can initially default the value from the Header to the Line.
For
example, you can default Purchase Order at the Header to Purchase Order at the
Line when you first create a PO number.
Note: The initial value
will default, but if you change the PO the new value will not default
automatically from the header to the line.
- You can also default the value of an attribute from another
attribute within the same entity. For example, you could default Promise
Date on the Line from Request Date within the Line Entity.
A defaulting condition is evaluated at run
time to select the appropriate default source assignments for all the object
attributes. You can define defaulting conditions that control defaulting of
object attributes of an object (data object) in given mode of functionality.
For example, you may have set up a condition for defaulting to occur one way if
the Payment Terms are A, and another way if the Payment Terms are B.
- Defaulting conditions created for an Entity must be based on
attributes within that Entity. For example, within the Lines Entity, you
cannot use the attribute Order Type because Order Type is a attribute
within the Header Entity.
A defaulting rule includes the following
components:
- Defaulting Source/Value (Entity and Attribute, Source Type)
- Defaulting Condition
- Precedence of Defaulting Condition (if multiple defaulting
conditions exist, precedence determines the condition to use)
- Sequence (in what order is the rule applied if multiple rules
exist)
- Source Type and Defaulting Source/Value: (how the attribute value
is derived
Defaulting Rules
You can define several different rules to
use in different order processing situations.
Sequence of Initial Attribute Defaulting
When attributes have equal sequence
numbers, defaulting takes place alphabetically. You can change these sequences,
if you need defaulting to happen in some different order. For example, you
might define a sourcing rule that says default attribute A on the line from
attribute B on the same line. In this case, you need to ensure that the
Attribute B is defaulted before A is defaulted, or the rule may not work as you
expect.
Alternatively, attribute A can be set up to
be dependent on Attribute B. Refer to 'Dependencies' section for further
details on how to set this up.
Defaulting Rule Sequences
Specify the priority sequence in which you
want to search for a field's defaulting value. Order Management looks at
the lowest sequence number initially to begin searching for a default value,
and continues to the next highest sequence number until it finds a value. For
example, if your first and second sources are null, but your third source
contains a value, Order Management uses your third source as the source.
Defaulting Sources
A defaulting rule source is the location
from which you obtain a defaulting value; usually the location is another
entity and attribute. For most attributes, you can assign at least one
entity/attribute defaulting source, in addition to using other defaulting
sources.
Defaulting Sources include:
- Same Record
- Related Record
- System Variable
- Constant Value
- Profile Option
- PL/SQL API.
For example, you may want to define a rule
to default the Price List to the order header based upon a variety of different
sources. Potential defaulting sources include customer agreement, customer, and
order type; the potential attribute for all three of these entities would be
Price List. You can choose any of the three source entities. Your choice may
depend on your business practices, whether those sources exist for a particular
order, and whether those sources have a price list defined for them. For the
customer, you may have defined separate price lists for the Bill To and Ship To
addresses in addition to the customer itself. All three of these fields are
available as sources.
Examples of Defaulting Sources
Profile Option
The profile option source enables you to
use a profile option, either system- or user-defined, as a default value
source. You must indicate the name of the profile option to be used as the
default value in your rule. Profile options sources enable for flexible default
value tailoring without complex customizations.
Note: If you intend to use a profile option as a
defaulting source, be certain that it is defined before attempting to reference
it in a defaulting rule.
Constant Value
The constant value source option enables
you to specify a constant value instead of a field that contains a
value. This is especially useful if you want your default to be the same value
or to be used if no other sources you have defined for your rule can provide a
value.
For example, if all items in your organization
are sold with the unit of measure Each, you could define a defaulting
rule to default the value of Each for the Unit of Measure attribute
within the Order Line entity.
System Variable
This system variable source option enables
you to default system variables or functions of system variables for a field.
This is commonly 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 if the policy of your
organization is to ship all items on the next day, you can setup the Request
Date defaulting rule with System Variable as sysdate + 1.
Same Record
Using same record as a source, you can
default an attribute from another attribute on the same entity record.
For example a common requirement is to
compute tax for an order line based on the scheduled ship date for that line.
Set up a defaulting rule for tax date with Same Record source and Source
Attribute as Schedule Ship Date.
Related Record
The Relates Record is one of the most
frequently used defaulting sources. Defaults for certain attributes can be
setup when defining related object records such as Customer, Ship To, Bill To
and Item.
For each attribute that you can use as a
default, related record source objects/ source attributes are pre-defined in
the system.
For example Order Type can be defaulted
from its value on the related objects: Customer, Invoice To, or Ship To. The
source attribute in each case would be Order Type.
PL/SQL API
If you have a complex defaulting rule that
cannot be defined using any other defaulting source, you can use the API
source. Your logic to derive default values can be coded into your custom
PL/SQL API, enabling you to reference you API within a defaulting rule.
See: Defining Defaulting Rules.
Dependencies
Some attributes are dependent upon the
value of other attributes on the same record. Dependencies can be established
only among attributes on the same entity, not across entities. The list of
available Source Attribute and Dependent attributes is pre-defined; most
attributes are available but some are not.
- If an attribute is changed, either by the user or by the system,
any attributes that are dependent on it will be cleared and then
re-defaulted.
For
example, the Freight Terms for the Header Entity is dependent on Agreement. If
the Header Agreement is changed, the Freight Terms for the Header entity will
be cleared and re-defaulted.
Note: Since the initial
release of Oracle Order Management, functionality for Defaulting Rules has been
slightly modified. Previous versions of Order Management allowed a change for
certain attributes such that if re-defaulting did not determine a default for
the dependent attribute, the previous value would be retained instead of clearing
the value. Attributes affected are:
- price list
- salesperson
- customer po number
- order type.
For example, the
Salesperson for the Header Entity is dependent on Customer. If the Header
Customer is changed, the Salesperson for the Header entity will be cleared and
re-applied. However, the new Customer does not have a value for Salesperson,
the old value is retained instead of clearing the existing value.
- The new functionality surrounding defaulting is available and part
of the core Order Management application beginning with the release of
Order Management Family Pack F.
If you
create a rule for attribute X based on a condition using attribute Y, ensure
that attribute Y is defaulted (not manually entered) before attribute X. Please
note that if you manually enter Y and want to default X based upon the current
value of Y, you will need to define a dependency where the source attribute is
Y and the dependent attribute is X.
For example, if you define a Condition for
defaulting the Unit of Measure by using the Customer, ensure that Customer is
defaulted before the UOM. If you were to enter the Customer and you want Unit
of Measure to re-default based on this new Customer value, you must define a
dependency for Unit of Measure on Customer.
If you wish to create additional
dependencies or disable existing dependencies, you can code a simple
customization in the dependencies API
For additional details on dependencies and
usage of the APIs within Defaulting Rules, refer to the Order Management white
paper "Defaulting Rules Setup" on Oracle MetaLink,
http://www.oracle.com/support/metalink/.
Effects of Modifications to Orders and
Rules
Modifications to orders may cause Order
Management to re-apply defaulting values from your defaulting rules. This
reapplication of defaults also may lead to changes that trigger another
default.
If re-application changes a value and
results in inconsistent information on the order, Order Management prevents
users from committing the order and provides messages to assist in correcting
the data. For example, depending on the defaulting rules, changing the line
type on the order line could change the price list on the line. If the line
items are not in the new price list, Order Management prevents you from
committing the order and issues instructions.
Modifications to defaulting rules take
effect for any new orders that use the modified defaulting rules when you open
the Sales Order Header or Lines windows or if you update an attribute (field)
on an order. If you do not or query an order or make a change to an existing
order that uses the modified defaulting rules, thus activating validations for
defaulting, then the order is not affected by the modification.
- During order and line defaulting, Order Management does not
replicate the value of defaulted attributes to all common lower level
entities (cascading) when performing updates to existing orders. If you
want to change the value of lower level entities for defaulting attributes
on existing order or line records, you should utilize Mass Change
functionality.
For
example, assume you have a defaulting rule set up to default the line-level
attribute Ship Method from the order header to all order line. You create an
order using Ship Method A, then add several lines. Since you are using Ship
Method A for the order header, each subsequent order line created will use the
default, Ship Method A. Now, you decide to change the Ship Method for the order
header to Ship Method B.
- Changing this attribute at the order header will result in any
subsequent new order lines created to use Ship Method B as a default.
Existing order lines that have Ship Method A are not updated to Ship
Method B as a result of your changing the header attribute.
- Use mass change to update order lines to Ship Method B.
Generating Defaulting Packages for Rules
and Conditions
To generate or update defaulting rules or
defaulting conditions, you must submit the Defaulting Generator concurrent
program. When you submit the Defaulting Generator concurrent program, a
defaulting handler package is generated for each attribute on each entity. The
creation of new rules or conditions, as well as modified rules and conditions
are not effective until the defaulting package for the attribute is
successfully generated.
The concurrent program must be submitted if
you perform either of the following:
- Update an existing defaulting rule.
- Update a defaulting condition: When validation rules for a
defaulting condition are updated, defaulting packages need to be
re-generated for all attributes of the entity.
- Disable a defaulting condition.
Defining Defaulting
Rules
You can create and modify defaulting rules
to improve the efficiency and accuracy with which you enter orders. You can
define the rules to determine the source and prioritization for defaulting
order information to reduce the amount of information you must enter manually
in the Sales Orders window. For most fields, you can assign one or more
defaulting sources in a priority sequence, or, if the default is always the
same, you can define a constant value.
Updates to defaulting rules take effect
once the Defaulting Generator concurrent program has been submitted for the
application and entity combination modified and the program successfully
completes for the entity combination modified. Existing orders are only
affected by updates to defaulting rules if you update an attribute on an order
that was included in the modified defaulting rule. If you do not perform a
change to an existing order that uses the modified defaulting rules, thus
activating validation of defaulting, the order is not affected by the modification.
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.
To query entities and
attributes:
- Navigate to the Defaulting Setup - Entity Attributes window.
The
Defaulting Setup - Entity Attributes window displays.
Entity Region
- Application--The Application field displays the application context
for the entity displayed. For Oracle Order Management, the value is
"Oracle Order Management". This field is non updateable.
- Entity--The Entity field displays the name of the object for which
defaulting rules and conditions are being defined such as the order line.
For Order Management you have the following options:
- Order Header
- Order Line
Attribute Region
The Attributes Region displays all the
entity attributes for which defaulting rules can be defined. You are currently
NOT allowed to enter new records here.
- The Defaulting Sequence field enables a user to assign the sequence
(priority) number in which this attribute should be defaulted.
Note: Attribute with identical sequence numbers are defaulted
in alphabetical order. e.g. If the order type has a sequence number of 1 and
the price list has a sequence number of 1, then the order type defaults before
the price list.
- The Attribute field stores the name of available attributes. Values
are currently defaulted based upon the entity selected.
- The Include in Building Defaulting Conditions check box indicates
whether an attribute can be used in defining conditions for the entity
selected.
Note: The Include in
Building Defaulting Conditions checkbox is for display purposes only, and
is non-updateable.
- Save your work.
The Defaulting Condition Templates button
enables you to define defaulting template and conditions for the
application\entity combination displayed on the defaulting rules setup window.
Selecting this button will take you to the Defaulting Condition Validation
Templates window.
The Defaulting
Rules button enables users to define defaulting rules for the attribute
selected. Selecting this button will take you to the Attribute Defaulting Rules
window. For more information on defining or updating defaulting sourcing rules,
see the Define Defaulting Rules section.
Select the Defaulting Condition
Templates button to define the defaulting condition for this entity.
Note: The template that appears after selecting the Default
Condition Template button is based upon current values displayed in the
Application and Entity field on the Defaulting Step screen.
To define Defaulting
Condition Templates:
- Navigate to the Defaulting Conditions Validation Templates window.
The
Defaulting Condition Validation Templates window displays.
- Defaulting conditions enable you to define conditions that can be
used to dictate how and when an attribute is sourced and defaulted. Select
an existing condition name if you wish to update the associated validation
rules or add a new condition name with associated validation rules.
- In the Description field, enter a brief description of the
condition.
Note: A generic condition
of Always is seeded for each entity. Use this condition to define
generic defaulting rules
- The Seeded check box will be checked for seeded conditions. This
field is protected against update. You cannot update seeded conditions or
validation rules associated with seeded conditions; however, you can
disable seeded conditions and create your own.
In
the Validation Rules Region, enter the validation rules based on the attribute
values of the above entity. For example, standard orders could have the order
type Standard. Order type = Standard.
- In the Group Number field:
- For conditions that should together evaluate to TRUE (AND
conditions), enter the same group number.
- For conditions that should together evaluate to OR (OR
conditions), enter a different number for each record.
- Select the Attribute name, such as Order Type.
- Select the validation operation: Select from:
- (>) Greater Than
- (<) Less Than
- (>=) Greater than or Equal to
- (<=) Less than or Equal to
- (=) Equal
- (!=) Not Equal
- Enter the Value String of the attribute that you want to validate
against.
- Navigate to the Defaulting Setup - Entity Attributes window.
The
Attribute name displays in the Attribute field. Descriptive Flexfield
attributes will not be displayed.
- Save your work.
Select
the Defaulting Rules button to define your defaulting rules.
To define defaulting
rules:
- Navigate to the Attribute Defaulting Rules window.
The
Attribute Defaulting Rules window displays.
Defaulting Conditions Region
- Enter a value in the Precedence field to determine the precedence
when resolving multiple TRUE defaulting conditions.
Note: If more than one
defaulting condition is valid, the conflict is resolved by internally ranking
conditions using the Precedence value. For example, defaulting condition Standard
Order has a precedence value of two and Copied Order has a
precedence value of one. If an order is standard and a copied order,
then the defaulting condition with higher priority, Copied Order, is used
initially. If your conditions for Copy Order do not return a default,
conditions for Standard Order will be evaluated.
- Select a Defaulting Condition from the List of Values and then
enter the defaulting rules to be used if this defaulting condition is
TRUE.
Note: The Always
condition should be the last in this sequence as it would always evaluate to True
and no other defaulting conditions would be evaluated.
- Select the Enable check box if you wish to enable the
defaulting condition. If this check box is not selected, the defaulting
condition is disabled and the rules and condition associated with this
condition are not used in default possessing.
- The check box for the field Seeded cannot be updated. This
value is seeded by Order Management. For seeded Order Management
defaulting conditions, you are unable to update or delete any fields
except:
- the Precedence field on the defaulting rule condition and
- the Enable check box. You can disable seeded Order
Management defaulting rules.
Default Sourcing Rules Region
- Select the priority Sequence in which you want to retrieve the
default for this attribute.
The
defaulting process searches for a default for your attribute by evaluating
defaulting rules in ascending order.
- Select the defaulting source type. The defaulting source type
determines data entry in the Default Source/Value field.
- Based on the default source type selected, either select the
default sources or enter default values in the Default Source/Value field.
The
table below describes Order Management Source Types and the appropriate action
required by a user.
Source
Type
|
Action
required
|
Constant Value
|
Enter the default constant value.
|
Profile Option
|
Select the profile option from where you want to
retrieve the default value.
|
Same Record
|
Select the attribute on the same record from
where you want to retrieve the default value.
|
Related Record
|
Object--Select the related
object.Attribute--Select the attribute on the related object from where you
want to retrieve the default value.
|
System Variable
|
Expression--Enter the system expression to be
evaluated to obtain the default value. (E.g. System Date.)
|
PL/SQL API
|
You can write a custom API to obtain a default
value if the value cannot be obtained using other source types such as, the
default order number from a sequence.Package--Enter the PL/SQL package
name.Function--Enter the function name.Object--Optionally, enter the name of
an object to be passed to this API.Attribute--Optionally, you can also enter
the name of an attribute to be passed to this API. (See the PL/SQL API Procedure
below.)
|
- Save your work.
Caution
If
defaulting rules or conditions are updated, the Defaulting Generator concurrent
program must be run to generate new defaulting packages.
- If you update an existing defaulting rule or condition from within
the Defaulting Rules window and the update is saved, a pop up window will
display a note reminding you to submit the Defaulting Generator
concurrent program.
- Choose to submit the program by selecting Defaulting Generator
from the Tools menu while within the Defaulting Rules window, or from the
Order Management SRS window.
- To generate the Defaulting Generator concurrent program for an
Entity, you must go to the Requests form and select your entity. This
will happen rarely in a production environment, but when necessary, it is
recommended that all users briefly log off the system while the entity
package is being re-generated. Otherwise, you may encounter record
locking constraints, and the defaulting package may not generate
successfully. It is unlikely that users will need to log off the system
when a package is being re-generated for an attribute only.
You
may execute the Defaulting Generator concurrent program while users are still
on the system, although the defaulting package may not generate successfully.
This can be due to the package currently being called by other users who are
processing orders on the system. Common errors within the output log file for
this concurrent program may contain text that a time-out occurred while waiting
to lock object.
If
defaulting packages do not generate successfully, you must choose to run the
program at a later time, or to have users briefly log off the system while
defaulting packages are regenerated.
Defaulting
Rule Example
Here
is an example of a defaulting rule that you can define so that a specific Price
List will default to the Sales Order Header window. You may also define a
sequence (priority) in which you want Order Management to search for a Price
List.
The
default sequence can also be complex. For example
Look
on an Agreement for a Price List, followed by the Invoice To Location, then the
Ship To Location, then the Customer, and finally, the Order Type. If Order
Management still does not find a price list for any of the source locations
listed (Invoice-To, Ship To, Customer, Order Type), you can have a Constant
Value default, such as 1998 USA Prices, which you enter in the Value
field of the Attribute Defaulting Rules window.
The
table below corresponds to the example stated above.
Sequence
|
Defaulting
Sources
|
Source
Field or Value
|
1
|
Related Record
|
Agreement.Price List
|
2
|
Related Record
|
Invoice To Location.Price List
|
3
|
Related Record
|
Ship To Location.Price List
|
4
|
Related Record
|
Customer.Price List
|
5
|
Related Record
|
Order Type.Price List
|
6
|
Constant Value
|
1998 USA Prices
|
Suggestion: Oracle Order
Management does not recommend that you define any overly complex or recurring
defaulting rules.
PL/SQL
API Procedure
The
signature of the PL/SQL API is:
function
function_name (p_database_object_name VARCHAR2,
p_attribute_codeVARCHAR2)
return
VARCHAR2
Note: Within this
function if you need to access other attributes on the entity, then you can use
the global entity record that is cached by defaulting: ONT_<Entity
Code>_Def_Hdlr.g_record and the datatype for this record is <Database
Object Name>%Rowtype.
The
table below describes Order Management entities, their associated entity code,
and the database object called when the entity is processed within an Order
Management.
Entity
|
Entity
Code
|
Database
Object
|
Order Header
|
HEADER
|
OE_AK_ORDER_HEADERS_V
|
Order Line
|
LINE
|
OE_AK_ORDER_LINES_V
|
For
example:
Function
to default order number from a sequence based on the order type:
Function
Get_Order_Number(p_database_object_name IN VARCHAR2,
p_attribute_code
IN VARCHAR2)
return
varchar2
IS
l_header_rec
OE_AK_ORDER_HEADERS_V%ROWTYPE;
BEGIN
--
Getting the defaulting global record
l_header_rec:
<= ONT_Header_Def_Hdlr.g_record;
--
for internal orders, use this sequence but for all other order types use the --
sequence for STANDARD orders.
if
l_header_rec.order_type_id = 1 then
return
to_char(OE_INTERNAL_ORDERS_S.nextval);
else
return
to_char(OE_STANDARD_ORDERS_S.nextval);
end
if;
END;