Now that we’ve covered the basics of Action Builder and Conditions, lets take a look at Results.
Once all the conditions of for an Action have been met, all the Results are processed, one after the other in the order they are specified. We’ve tried to add Result types that cover a lot of the script we see in forms, and a lot of the questions we see posted to places like the LiveCycle Designer ES forum.
Here is a list of the Results currently available:
Many of these are self-explanatory, but a couple warrant a deeper look.
Set the Value of a Field
You can use this result to set a field to a particular value, or, for some types of fields, to special values. When you choose this result row type, you’re prompted to select an object. The options you get for the value you can assign are based on the type of object, and some of them are particularly useful.
When setting the value of a Numeric field, you can specify a numeric value, but you can also specify that you want the value set to the current page number, or the number of pages in the form. When setting a Date/Time field, you can specify a particular date, or you can specify that you want it set to today’s date.
For a Drop-Down List with values specified, you’re able to select the value from a list:
Call a Script Object Function
This is a great way to extend what’s possible with Actions without having to write script. A developer can supply a script object that can be dropped into a form, and then called using the Call a Script Object result.
So let’s say I have a Script Object that translates English text into Pig Latin. I want to make it easy for any form designer to use this script. What do I do?
Make it a Script Fragment. A user can then drag that script fragment into the hierarchy to add it to the form, and reference it from an Action.
Here’s what the Result row looks like for a call into a function called fTranslate in a script object called MyUsefulScripts:
The parameters you type in here are passed through to the function verbatim. The result can either be ignored, or assigned to a field. In this case we’re taking the result and assigning it to a text field.
The end result?
Without the form designer having to write any script by hand, they can use the script in the Script Object to translate text into pig latin.
Note to self, find more compelling demo…