Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Restricting Actions on Sales Orders using Processing Constraints and Validation Templates

Author: Amit Jain

Declaration
I hereby declare that this document is based on my personal experiences. To the best of my knowledge, this document does not contain any material that infringes the copyrights of any other individual or organization.

Target Readers
Oracle Apps Customization Oracle Apps Implementation

Keywords
Validation Templates Order Management Constraints.

Introduction

Page 1 of 6

The scope of this document is to give an overview about setting up the Processing Constraints and Validation Template to restrict the actions on Sales Order based on specified conditions based on the business needs. This can be dubbed as a very powerful feature supported by Oracle R12. We can devise our own string of conditionality on the Sales Order Header and Line data to restrict the actions performed by user/ system.

What are Processing Constraint & Validation Templates?

Processing Constraints Processing constraints is a common security framework in Order Management where we can define and build security rules around sales entities (Line, header , line payments etc). Using processing constraints in Order Management we can define the conditions and status at which an update can be made to an entity. For example a line cannot be cancelled after it has been shipped. This can be seeded as a system constraint to prevent data corruptions. Similarly we can define constraints that suit our business practices and prevent changes. These constraints can be defined at the entity level and for each attribute. When we attempt to make changes to an order, Order Management validates the changes against processing constraints enabled. In addition, Order Management validates the order changes based on the user responsibility. Validation Templates The templates are absolutely imperative for any Processing constraint to work. We define our own business specific scenarios in the validation templates that subsequently guides processing constraints to allow/ disallow a specific action on the Order Entities. The validation extends a great degree of flexibility to place our logic using Custom/ Seeded database package, Workflow, Table column values. While defining the Validation Template, we have three Options 1.Template based on API 2.Template based on Workflow 3.Template based on Table
Requirement & Problems Faced After our client upgraded their system on R12.1.3 from R11.5.10, they were running into a grave problem that the Cancelled quantity was not getting updated on the Internal Requisition Lines in the scenarios where the partial Shipment lines were in transit. Though Oracle had logged a bug for the issue still, the problem reported as mentioned above could not be fixed through the patch. I had proposed to the client to prevent the Partial Cancellation of the lines where the Shipments were in transit. The problem encountered was pertaining to Internal Requisition- Internal Sales order business

Page 2 of 6

flow which was creating the noise for the working of our other enhancement objects as well.
Solution

Step 1 Create a new Database package that will be called from the Validation Template of Type = API. Enclosed herewith a sample POC code.

This API will return 0 if the Sales Order Line is Internal Order Line and if the Shipment is in-transit else it will return 1. The file contains xx_check_pending_rec_pkg Package with check_pending_rec Procedure. The signature of procedure written inside will always be as below:
PROCEDURE check_pending_rec ( p_application_id IN NUMBER, p_entity_short_name IN VARCHAR2, p_validation_entity_short_name IN VARCHAR2, p_validation_tmplt_short_name IN VARCHAR2, p_record_set_short_name IN VARCHAR2, p_scope IN VARCHAR2, x_result OUT NOCOPY NUMBER );

Add a new Validation Template as indicated in the screenshot below.

Page 3 of 6

Now we need to define the Processing Constraints to prevent the users from cancelling the ISO line if the shipment is in transit which in turn will call the Validation Template created above

Create a new Constraint now for the Order Line as indicated in the Screenshot below

Page 4 of 6

Now we will try to cancel the order line which has in-transit shipment.

Page 5 of 6

This is just one of the Proof of concepts that I have designed for meeting the business requirement. However, the same functionality of Validation Templates and Processing Constraints can be used far beyond what has been depicted in the article above.
References: 120ontig.pdf Order management Implementation Guide http://docs.oracle.com/cd/B34956_01/current/html/docset.html

Page 6 of 6

You might also like