Overview of Groovy Scripts

Groovy is a standard, dynamic scripting language for the Java platform. You write Groovy scripts using Application Composer's expression builder, which appears in many places as you modify existing objects or create new custom ones.

Read this chapter to learn about how and where you can use Groovy scripting in Application Composer.

Note: To fully understand all the scripting features available to you in Application Composer, you should also review the Groovy Scripting Reference guide.

In this chapter, you will learn about:

  • Where you can use Groovy in your application, along with examples of one or more lines of Groovy code

  • How to access view objects using the newView() function, for programmatic access to object data

  • How to create global functions, which is code that multiple objects can share

  • How to call Web services from your Groovy scripts. You might call a Web service for access to internal or external data, or, for example, to perform a calculation on your data.

What kind of scripts will you write?

You write Groovy scripts using Application Composer's expression builder, which appears in many places throughout Application Composer as you modify existing objects or create new custom ones.

  • You will write shorter scripts to provide an expression to calculate a custom formula field's value or to calculate a custom field's default value, for example.

  • You may write somewhat longer scripts to define a field-level validation rule or an object-level validation rule, for example.

Additional examples of where you write Groovy scripts in Application Composer are described in "Groovy Scripting: Explained."

To learn more about how to best use the features available in the expression builder when writing scripts, see "Groovy Tips and Techniques" in the Groovy Scripting Reference guide.