Previous  Next          Contents  Index  Navigation  Glossary  Library

Writing Transaction Control Extensions

Oracle Projects provides a template package that contains the procedure that you modify to implement transaction control extensions. The name of the package is patcx, the name of the procedure is tc_extension.

Print out and review the following files before you begin writing transaction control extensions. These files are located in the Oracle Projects admin/sql directory.

PAXTTCXB.pls. Transaction Control Extension Package Body Template. This file contains the procedure that you modify to implement transaction control extensions. You can define as many procedures as you like within this package or within the predefined procedure.
PAXTTCXS.pls Transaction Control Extension Package Specification Template. If you create procedures outside the predefined procedure within the patcx package, you must also modify this file to include those new procedures.

Suggestion: After you write the procedure, do not forget to compile it and store it in the database. See: Storing Your Procedures.

We recommend that you use the PL/SQL User's Guide and Reference Manual and the Oracle Projects Technical Reference Manual as reference material while defining procedures:

Writing Error Messages

You write error messages that will be displayed in forms when a transaction control violation is encountered. Use these messages to tell users why a particular transaction cannot be entered, based on validation in the procedure. These messages also appear on the Transaction Import exception report and indicate the reasons why transactions may be rejected by Transaction Import.

Be sure to define your messages under the Oracle Projects application. If you define your messages using the prefix PATXC, Oracle Projects will protect them during an upgrade.

If you are using any of the following processes or products, you must define the message in the character-based form as well as the GUI window:

If you define the message in the GUI window, the messages are stored in the table FND_NEW_MESSAGES. If you are defining the messages in the character-based form, the messages are stored in the table FND_MESSAGES. Please make sure that the message name is identical in both tables prefixed with PATXC.

Package.Procedure

patcx.tc_extension

Table 1 - 105 lists the parameters that Oracle Projects provides for the transaction control extension. All values are passed from the expenditure item being validated.

Parameter Usage Type Description
X_project_id IN NUMBER The identifier of the project.
X_task_id IN NUMBER The identifier of the task.
X_expenditure_item_ date IN DATE The date of the expenditure item.
X_expenditure_type IN VARCHAR2 The type of expenditure.
X_non_labor_resource IN VARCHAR2 The non-labor resource; for usage items only.
X_incurred_by_person_id IN NUMBER The identifier of the person incurring the transaction.
X_quantity IN NUMBER The quantity of the transaction.
X_transferred_from_id IN NUMBER The identifier of the original expenditure item for which a new item is interfacing to a new project.
X_incurred_by_org_id IN NUMBER The organization incurring the transaction.
X_nl_resource_org_id IN NUMBER The identifier of the non-labor resource organization; for usages only.
X_transaction_source IN VARCHAR2 The transaction source of items imported using Transaction Import.
X_calling_module IN VARCHAR2 The module calling the extension.
X_entered_by_user_id IN NUMBER The identifier of the user that entered the transaction.
X_attribute_category IN VARCHAR2 Expenditure item descriptive flexfield context.
X_attribute1-10 IN VARCHAR2 Expenditure item descriptive flexfield segments.
X_billable_flag IN OUT VARCHAR2 Determines whether or not a transaction is billable or capitalizable.
X_outcome OUT VARCHAR2 The outcome of the procedure.

Additional Information About Parameters

Using Attributes

For the X_attribute parameters, you can use any attribute from the expenditure item descriptive flexfield. These parameters are not available for modules outside Oracle Projects.

Using Quantity

You can use the quantity parameter for validation using Oracle Projects and Oracle Payables features. However, keep in mind that Oracle Purchasing does not pass a value for this parameter.

Using Incurred by Person

Oracle Projects passes the person who is incurring the transaction. This value is always specified for labor and expense report items. It is optional for usage items, because you can enter usage logs which are incurred by an organization, and not an employee.

Oracle Payables passes a parameter value for supplier invoice transactions if the supplier of the invoice is an employee; otherwise this value is blank for supplier invoice transactions.

Oracle Purchasing does not pass a value for this parameter for requisitions and purchase orders transactions.

Using Billable/Capitalizable Flag

Oracle Projects passes in the billable value (contract projects) or capitalizable value (capital projects) that it has determined from the project and task transaction controls and the task billable status for this parameter. You can override this value based on logic that you write in your procedure. You can pass back a value of Y or N to specify the default billable or capitalizable status of a transaction. If you do not pass back a value, or if you pass back an invalid value, Oracle Projects uses the original value that it determined before calling the transaction control extension procedure.

Using Outcome Parameter

Use the X_outcome parameter to pass back the outcome of the procedure. If the transaction successfully passes all applicable transaction control extension rules that you defined, leave the X_outcome parameter value as a null value. Oracle Projects then knows that this transaction passed all transaction control validation.

If the transaction does not pass a rule that you define, set the X_outcome value to the appropriate error message name that will be displayed to the user.

Using Calling Module

The calling module parameter indicates where the transaction control extension is being called from. You can base the logic of your extension on the calling module. For example, if Transaction Import is the calling module (PAXTRTRX), then allow only certain types of transactions to be charged to specific projects.

Below is a list of the possible values for the X_calling_module parameter. Note that these values are case-sensitive and are passed exactly as they appear.

When transaction controls is called by Oracle Purchasing and Oracle Payables, the validation is performed when you enter project-related information for requisitions, purchase orders, and supplier invoices. The validation is also performed when you enter or update the project-related information for distribution lines.

APXINENT Invoices Workbench in Oracle Payables. This value is passed when Transaction Controls is called to validate project-related information entered on a supplier invoice.
CreateRelated Item CreateRelatedItem procedure called in the labor transactions extension procedure. This value is passed when CreateRelatedItem calls Transaction Controls to validate related transactions in the labor transactions extension procedure.
PAVVIT Interface Supplier Invoices from Payables. This value is passed when Transaction Controls is called to validate expenditure items being created from project-related supplier invoice distribution lines interfaced from Oracle Payables into Oracle Projects.
PAXTREPE Pre-Approved Expenditures. This value is passed when Transaction Controls is called to validate unapproved expenditure items being entered or updated in the Enter Pre-Approved Expense Reports form.
PAXTRTRX Transaction Import. This value is passed when Transaction Controls is called by the Transaction Import program to validate transactions before they are loaded into Oracle Projects.
PAXEXCOP/ PAXTEXCB Copy Pre-Approved Timecards/Copy Expenditures. This value is passed when Transaction Controls is called to validate new expenditure items being created using the Copy Pre-Approved Timecards feature.
PAXPRRPE Adjust Project Expenditures. This value is passed when Transaction Controls is called to validate a new expenditure item that is being created as a result of an expenditure item transfer performed in the Adjust Project Expenditures form.
POXPOEPO Purchase Orders in Oracle Purchasing. This value is passed when Transaction Controls is called to validate project-related information entered on a purchase order.
POXRQERQ Requisitions in Oracle Purchasing. This value is passed when Transaction Controls is called to validate project-related information entered on a requisition.
POXPOERL Releases in Oracle Purchasing. This value is passed when Transaction Controls is called to validate project-related information when you enter releases against purchase orders.
POXPOPRE Preferences in Oracle Purchasing.


         Previous  Next          Contents  Index  Navigation  Glossary  Library