Can I create a trigger that only works on certain records within a table view?

Document ID : KB000055497
Last Modified Date : 14/02/2018
Show Technical Document Details

Description
Triggers allow you to click on a column or an entire record in a view and perform some action based on the values in that view. There are some cases where you may not want to perform an action on particular rows. For example, if the value of the column you are using is null, you may not want to use the trigger action in that case. This document will outline steps to create a conditional trigger.

Solution

We will use the following table as our example:

Figure 1

In this example, we want to be able to click on a state and produce a view that shows data specific to that state. Notice that some of the records have nulls for the state. In these cases, we would not want to execute the trigger. So if we right click on the view and select Layout and Columns, we get the following dialog:

Figure 2

Click on the Next button until you see the State column listed in the Title field. Now click the Triggers tab to display this dialog:

Figure 3

The value field is the value that F&T checks for when users point at values in the view's result. If the result value pointed at matches the trigger's Value, the mouse pointer turns into a finger and clicking activates the trigger; otherwise, the pointing finger does not appear and clicking does nothing. In our example, we do not want the finger to appear when the value of state is Null. Therefore we can use a wild card to say when there is at least 1 character followed by 0 or more characters, execute the trigger. An underscore (_) represents any single character and the percent sign (%) is the wildcard character. So a value of _% will match any single character followed zero or more other characters. So a null would not match this value and the trigger would not be available. For more information on the wildcard characters, see the Forest & Trees Help.

The next field is called "Store Value in Substitution". This is the name of a substitution that will store the clicked value when the trigger executes. In our example, the clicked state will be stored here to be used in the state info view.

In the drop down list, choose Execute Formula and type in a formula that will execute the State_Info view.

Finally click Add. So your Trigger dialog will look as follows:

Figure 4

Now click OK. So now you will see that when you hover over a state, your mouse pointer will become a pointing finger signifying that you can execute a trigger. Hovering over a null value will not change to the pointing finger and you will not be able to execute the trigger.

We take pride in our technical documents and are interested in your feedback. Please email your comments to us directly at: portalsdksupport@ca.com
Be sure to include the document id in the message