Skip to Main Content

Breadcrumb

Overview

The FOS - Client-side Condition dynamic action plug-in is the ideal solution for adding if/then/else conditions to determine whether the following actions within the dynamic action should be continued.

This plug-in gives you the ability to specify a client-side condition to control whether the execution of dynamic actions continues or stops. If the condition evaluates to TRUE, then the rest of actions are executed, if the condition evaluates to FALSE, the execution stops and an optional "ELSE" custom event can be triggered.

If you require more branching logic than what this action provides we suggest you look at the "FOS - Trigger Event(s)" action which has a similar but more extended behaviour than this plug-in.

Examples

Regular Conditions

The following conditions can be used to control whether the actions defined after the "FOS - Client-side Condition" can continue or not:

  • Item = Value
  • Item != Value
  • Item > Value
  • Item >= Value
  • Item < Value
  • Item <= Value
  • Item is null
  • Item is not null
  • Item is in list
  • Item is not in list
  • JavaScript Expression

Note: these conditions are the exact same client conditions you can use on the dynamic action itself which APEX already provides. We re-use the Javascript API that APEX provides to evaluate them, so you can be safe in the knowledge that you are using something well tested and used.

Additional Conditions

In addition to regular client-side conditions we have included several additional page API checks. The following conditions can be used to control whether the actions defined after the "FOS - Client-side Condition" can continue or not:

  • Page is Valid
  • Page is Invalid
  • Page has Changed
  • Page has not Changed

Note: these conditions are based on the Javascript API that APEX provides, so you can be safe in the knowledge that you are using something well tested and used. We also welcome user feedback as to what other conditions you would like us to include, so please let us know.

Server-side Conditions

What if I need to run a condition on the server i.e. in the database by executing some PLSQL? The answer is simple: just use the "FOS - Execute PL/SQL Code" dynamic action to perform the check and return the result into a page item. Then use this page item in your condition check as per this example.

Note: you must ensure that you enable "Wait for Result" on your "Execute PL/SQL Code" action.

Design

You can preview the plug-in setup as you would see it in page designer. You can either do this by clicking this button in the top right corner of each example, or you can see all the examples together in the region below.

Looking at the examples you'll see just how easy the plug-in is to use. Don't worry about changing any values as they aren't saved. We actually encourage you to change them, so you can see the behaviour of the attributes and their help text.

FAQ

  • The page level checks are great, how can we add more of these type of checks?

    Currently we only provide the page level API checks. If you have some great ideas please let us know by creating an issue on GitHub for this plug-in. If you would like to include more checks, for now you will need to use the "Javascript Expression" type. Here are some examples for other type of checks which we may include in the future:

    Interactive Grid is Loaded

    
    apex.region('GRID_STATIC_ID').call('getViews','grid').model._data.length > 0
    
    

    Interactive Grid is Empty

    
    apex.region('GRID_STATIC_ID').call('getViews','grid').model._data.length === 0
    
    

    Please Note: we do not support the above code so use it at your own discretion. This is because we have not found an API call to retrieve the record count and we are accessing a private variable, which the APEX team may change in the future. It's just an example to give you an idea of what type of declarative checks we could include.

  • Does it matter if I use upper or lowercase for my ELSE event name?

    No it does not matter what case you use for your ELSE event name, it's a personal choice. The preferred standard though is to use lowercase and use "-" hyphens for spaces to make them easier to read. We suggest that you just stick to letters and hyphens and no other special characters. Note: if you use a "." in your event name you will be defining a namespace. Please see the following documentation for more information on event namespaces.