Article Details
Id:17289
Product:finPOWER Connect
Type:NEW
Version:3.03.03
Opened:12/08/2020
Closed:13/08/2020
Released:01/10/2020
Job: J024820
High Importance

Portals; Fallback values can now be specified in <%Constant%> and <%UserData%> tags meaning that invalid JavaScript can be avoided

<%Constant%> and <%UserData%> tags can be inserted into various Portal resources and pages.

However, if the value does not exist (e.g., User Data has been cleared or the item has been removed from the Constants grid, this may result in invalid JavaScript being produced, e.g.:

var showMessage = <%Constant:ShowMessage%>;

The above assumes that a "ShowMessage" Constant is defined AND that it is a Boolean type. However, if no Constant with this name exists then the tag will simply be replaced by a blank value which will result in the following, invalid, JavaScript code:

var showMessage = ;

A fallback value can now be specified by including it in braces at the end of the tag, e.g.:

var showMessage = <%Constant:ShowMessage(false)%>;

This will prevent invalid JavaScript being produced and is applicable to both <%Constant%> and <%UserData%> type tags.

NOTE: For String values, the value in braces should include either single or double quotes.

WARNING: If the User Data or Constant value is NOT found and a default is not specified then the value "null" will be inserted. This may look odd in HTML but will prevent JavaScript code from failing to compile.

The sample Client Connect Portal has been updated to specify default values where Constant and UserData tags are used in JavaScript code.

The following Portal has been updated:

  • CC (Client Connect)
  • Version: 1.04 (13/08/2020)

The Portals document has been updated to reflect these changes.