Overview of Creating Order Management Extensions

Write your own Groovy script that modifies your Order Management deployment, implements your own functionality, and specifies the extension point that determines when to run this script.

An order management extension is a Groovy script you write that meets your specific business requirements. An extension point is an event that you specify to determine when to run the script.

You can use a flexfield to modify the data model, or Page Composer to modify the user interface, but you can't use them to modify logic or modify your Order Management deployment. Instead, you can create an order management extension.

Here is some Groovy script in an example extension named Update Order Submit Date. It uses attribute _H1AttributeDateTime so it can set the value of an extensible flexfield to the date and time when Order Management submitted the sales order.

Extension That Modifies Order Management

Business Requirements That You Can Meet with an Order Management Extension

Example Requirement

Description

Get or update data

Create an order management extension to get or update data from different sources.

  • Use the getAttr method to get data from Order Management.

  • Use a public view object (PVO) to get data from an Oracle application.

  • Use a web service to get data from a source that resides outside of Order Management.

You can also use a transformation rule to get or update data, but an extension allows you to use more advanced code. You can also use it to add new order line.

Set the default value for sales order attributes or extensible flexfields

You can use a pretransformation rule, posttransformation rule, or do some simple personalization in a user's sandbox, but you might find that using Groovy to write your own logic more closely meets your need to set default values before you save the sales order or submit it to order fulfillment.

You can use an extension to:

  • Create simple or complex scripts.
  • Set default values from the order header to order line.
  • Set default values from the original sales order to a return order.
  • Get default values from other Oracle applications or work areas, such as Oracle Procurement or Product Information Management.
  • Use a SOAP service to make a web service call to an application that sits outside of Oracle.
Validate data

Validate data on different attributes on the same entity, such as an order header, or on attributes on different entities, such as on the order header and the header's order lines.

Compare data between attributes on an order header or order line to data from attributes in other applications or workareas, such as entities in Oracle Pricing or attributes on item's from Product Information Management.

Get values for return lines from the original sales order.

A return order doesn't include values from the original order on some order line attributes. For example, the return line doesn't include the original value for the sales credit or purchase order number. You can use an extension to get the value from the original line order.

Apply a hold You can manually apply a hold in the Order Management work area or through a web service, but you might find it's easier to do it automatically through an extension:
  • Automatically apply a hold according to a condition or attribute value
  • Apply a hold with the On Save or the Start of Submission extension point.

Display error messages and warnings

Create an extension that displays an error message or warning.

Implement your own logic

Use Groovy to write your own logic when you code your extension. Your code can validate the sales order. If validation fails, then your code can stop the flow and create a message.

For details about Groovy, see Groovy Programming Language.

Example Actions

Action

Description

Submit a sales order

  • Reassign the warehouse for pick-to-order. Set up an item that determines whether the sales order references a pick-to-order or a hardware model.

  • Stop support lines that reference an incorrect accounting rule. Set up item entities and accounting rule entities.

  • Make sure only one contract is Active or Signed for a booking. Set up entities for the installed base, contracts, or Order Management.

  • Assign a sales representative. Set up sales compensation rules.

  • Update the accounting rule for a model for included items.

  • Update the quote status for each sales order from a store front that a third-party partner maintains.

  • Verify the purchase order number that the Order Entry Specialist enters on the sales order equals a purchase order in Oracle Procurement.

  • Assign the Salesperson according to a sales compensation rule that you create in some application outside of Oracle Applications, then use a web service to call the application.

  • During order import, copy attachments from a purchase-to-order kit to each item that the kit contains.

  • Set the default value for order preferences in each sales order. Get these values from the customer master.

Save or validate a sales order

Write a validation on an imported source order that rejects the import or prevents the Order Entry Specialist from saving the order without fixing the problem.

Parts of an Order Management Extension

Part

Description

Function

A Groovy function, similar to a Java function, such as getAttr. Use a function only in the extension where you set it up. You can't define a function in one extension, and then use it in another extension.

Attribute

The attribute of a sales order, such as ShippingInstructions.

Web Service

The name of a web service.

  • Your extension code can only call a web service that you set up on the Manage Web Service Definitions page.

  • You must manually create the request payload in your code.

  • Your code must parse and interpret the response payload.

  • You must write your code so it works only for a synchronous interaction. You can't write code for an asynchronous interaction.

Message

A message you send to Order Management and that can display in the Order Management work area.

  • An extension can log an error or warning message in the messaging framework.

  • Order Management logs each message in a log file as part of order import or when a web service rejects a sales order.

  • An error message stops the flow and rejects the save or submit action.

  • A warning allows the flow to continue. If you use a warning at the beginning of a submission request, then Order Management displays the warning message to the Order Entry Specialist, then continues to process the sales order in order fulfillment.

  • Use the Manage Messages page to define messages and tokens.

  • Use tokens to insert dynamic content into each message.

  • Modify the DOO_MSG_REQUEST_FUNCTION lookup to categorize the errors that Order Management displays to the Order Entry Specialist and improve search for these errors.