Building actions in LiveCycle Designer

While we’re looking at LiveCycle Designer, here’s another great new tool that will help you avoid writing potentially long and tedious script. It’s called Action Builder and it’s pretty powerful. You can use it to define actions that will add or remove fields or sections of your form, set field values, change field or background colours, hide or show objects, or set focus to a specific field. All without writing any script by your yourself.

In this example, we want to either show or hide a bunch of credit card fields depending on the Payment option that was selected.

actionbuilder4.jpg
actionbuilder5.jpg

Assuming you have a form with these fields already on them, you would follow these steps (a link to the sample form is below):

  • Select Tools > Action Builder…
  • Click the “Add a new action” icon
  • actionbuilder1.jpg

  • Set the condition by selecting an object and a corresponding event. You can create multiple conditions with AND/OR operators. But for this example we’ll set only one condition for each action. For the first action, we want a result to be triggered when “Credit Card” has been selected by the end user.
  • Set one or more results. In this action we want a bunch of fields to become visible.
  • Create a second action. This time the condition will monitor for when the Credit Card option is NOT selected. When the condition is met, it will trigger several results that will make the fields invisible
  • actionbuilder2.png

    actionbuilder3.png

    Action Builder creates what is called “managed script”. You can see this script in the Change event of the Payment field. You can, of course, edit this script – but it’s not recommended. And if Designer detects any modifications it will assume that you’re taking control and the script will become unmanaged.

    Here’s the sample pdf if you want to take a look: Registration.pdf

    Ernest