Sunday, October 12, 2014

Application Composer-1

Application Composer Series: An Introduction To Global Functions

Global Functions allow you to create common utility code programs that you can call from the custom triggers and workflows added in Application Composer. Global Functions help increase the modularity and clean design for your customizations, allowing them to be easier to understand and maintain going forwards.
If you've not seen this feature before, check out this simple video demonstration from our YouTube channel.
To help illustrate how these fit into the overall Application Composer architecture, the following simple diagram shows how Object Functions are available in the context of only each object (e.g. Opportunities) whereas Global Functions are available across applications for use in code within object events (such as triggers and buttons) and in object functions.

Usage Tips

  • There are no seeded Global Functions at this time (the diagram above gives suggestions only), however we are looking at building a library of common utility code. More to come on this.
  • Global Functions support a wide use of input parameters and return types. These are: String, Long, Double, Date, Boolean, Object, List, and Map.
  • To use your current view object instance (e.g. Opportunity 1234) you can pass it as an input variable.
  • Release 9 introduces validation of known high-risk API's to avoid using in your groovy scripts. The recommended API libraries to use are documented here.
  • Global Functions can only be created using Application Composer and to prevent problems it does not support uploading file libraries or code artifacts into the system.

Illustrative Example

The following Global Function is taken from the integration example for Sales Cloud with E-Business Suite (Doc ID 1620455.1), which uses an extensive library of Global Functions. As you can see it searches for Sales Accounts, returning the object for use in the calling code. It also uses other global functions as well, including O_INT_ApplyFilter for manipulating the view criteria and two more for logging operations in the catch block.

No comments:

Post a Comment