Monday, October 15, 2007

An Introduction to Triggers

Snapp MX Triggers are one of the most powerful tools one has when creating a screen. Basically triggers are a set of actions you would like to do on a screen based on a condition.

There are a ton of actions available to you including (but not limited to): Enabling and Disabling Form Fields and Buttons Showing and Hiding Form Fields, Buttons, Images, Lists, Trees, Charts Clearing, Setting and Copying Form Field Values Refreshing Lists, Trees, Charts Moving (Animation) Objects Renaming Labels and much more!

As you can see, there are many trigger actions that can change not only how your screen will look, but how it will work.There are 3 main types of triggers available for you to use:
  • On Load Triggers (triggers that run when a screen is first loaded)
  • On Change Triggers (triggers that run when a form field value has been changed by the end user)
  • On Click Triggers (triggers that run when a button, image or label has been clicked)
To set up a trigger, first create a screen, then go to Options > Triggers in the Main Menu bar.
  • Click on the "Add" button corresponding to the type of trigger you wish to create.
  • Create a Trigger Condition using the Condition generator, and
  • Add actions based on the Condition being Met or Not Met
Real life examples of what we have used triggers for in the past:
  • Enabling / Disabling Form Fields (or Buttons) based on who is logged in (or type of user)
    • On Load Trigger
    • Example: Only the Admin users can click on the "Save" Button
  • Showing / Hiding Form Fields based on other Form Fields
    • On Change Trigger
    • Example: Clicking on a Complete checkbox shows the Completed Date Form Field
  • Refreshing a Chart based on a Button press
    • On Click Trigger
    • Example: Chart data based on a Date Form Field, User can change Date, and click a Button to Refresh the chart.
Click here to see some triggers in action!

We hope you enjoyed this introduction, and am sure you are well on your way to understanding and using triggers