Data Issues Report Bind

The Data Issues Report bind allows running a JavaScript-based business condition to display custom warning and error messages related to attributes, references, and metadata in the Web UI and within Smartsheets.

All Data Issues Report methods are available in the Technical Documentation accessible at [system]/sdk or from the system Start Page.

For a Web UI Node Details screen, error and warning messages display below the affected field and in a popup at the top-center of the screen. For Web UIs with the Global Navigation Panel configured, they also display in the 'Recent warning notifications' side panel. For more information, refer to the Recent Warning Notifications Side Panel topic. For Web UIs using the superseded Corner Bar component, they can also display via the superseded Corner Bar Warning Notifications component.

For Smartsheets, upon validation, the messages are displayed when clicking on / hovering over the cells. Warnings are identified via orange-highlighted cells, and errors via red-highlighted cells. If both an error and a warning are found in the same row, the error supersedes the warning and the first cell in the row displays with a red highlight. For more about using Smartsheets, refer to the Using a Smartsheet topic in the Data Exchange documentation.

For objects using a Data Issues message and both the Mandatory and Read Only binds with messages, the message order is Data Issues, Mandatory, and then Read Only.

For general information about the Data Validation binds, refer to the Data Validation Binds topic .

This bind is found within the 'Binds to' dropdown, as shown below.

Configuration

To use any bind:

  1. Create a business rule as defined in the Creating a Business Rule, Function, or Library topic.

  2. Edit the business rule as defined in the Editing a Business Rule or Function topic.

  3. In the Edit Operation dialog, add the bind to a business rule, as defined in the Adding a Bind topic in the Resource Materials online help documentation.

  4. In the Edit Operation dialog, optionally add Messages, as defined in the Localized Messages for JavaScript Business Rules topic.

  5. In the Edit Operation dialog, add JavaScript to call the bind.

Examples

The following JavaScript examples use the related bind(s).

Important: Example scripts should not be used as-is without thorough testing, including updating the script to match object and link types that exist on your system. JavaScript variable names are case-sensitive.

The Data Issues Report bind supports attributes, references, and metadata in the Web UI, allowing users to view error messages directly below the relevant on-screen component, or within the relevant table.

Attribute Value Examples

A Node Details component includes a business condition to validate that when the value for the attribute 'Region' is 'Europe', other attribute values are also added. When the 'Europe' value is entered, an error is displayed for the 'Industry' attribute and a warning is displayed for the 'Ownership' attribute, as configured using the Data Issues Report bind.

Copy
var showDataIssues = false;
var attrHome = manager.getAttributeHome();
var region = currentNode.getValue("Region").getSimpleValue();

if (region == "Europe"){
showDataIssues = true;
diReport.addError("Data Issues: Europe region validate Industry", currentNode, attrHome.getAttributeByID("SAP-KATR1"));
diReport.addWarning("Data Issues: Europe region validate Ownership", currentNode, attrHome.getAttributeByID("SAP-KATR2"));
}

if (showDataIssues) return(diReport);
return(true);

In the example JavaScript above, the 'addError' method displays the custom text with an error icon for the notification. The 'addWarning' method displays the custom text with a warning icon. In addition to the visual indicators on the messages, an 'addError' message disables the save button until the described issue is addressed, while an 'addWarning' message allows users to save on-screen data.

In the Web UI, the data report messages show as in this image:

Attribute Values within Data Containers Examples

The Data Issues Report bind allows running a JavaScript-based business condition to display custom warning and error messages related to attributes and globally configured references within the Globally Configured Unfolding Data Container and the Globally Configured Multi Edit Data Container.

The Data Issues Report bind can be made valid for specified attributes and globally configured references within a specific data container type or data container instance.

When these data containers are displayed on a Node Details screen within the Web UI, customized error and warning messages are shown below the affected field and in a popup at the top-center of the screen. The affected columns or cells within the data containers are highlighted in red or orange, depending on the severity.

Below is an example of a Data Issues Report bind configured within the Globally Configured Unfolding Data Container. If you enter an invalid email address and click out of the field, a warning message near the field and a warning notification are displayed.

In another example, an invalid value (3100-4-1) is selected in the Create dialog of the Globally Configured Multi Edit Data Container, triggering a warning that states that ‘3100-4-1 is invalid for this customer’.

If proceeding with adding the value to the data container, the cell will be highlighted in the data container table, and hovering over the warning icon will display the same warning message.

The user can then click on the affected cell to edit it, while the remaining cells in the row remain uneditable until a valid value is selected.

Smartsheet Example

For Smartsheets, the business condition including the Data Issues Report bind must be configured on the 'Select Business Rules' step of the Import Manager wizard. For more information, refer to the Import Manager - Select Business Rules topic in the Data Exchange documentation.

Additionally, the Smartsheet import configuration must be linked to the Smartsheet export configuration. This is done on the 'Select Format' step of the Export Manager wizard. For details, refer to the Export Manager - Select Format topic in the Data Exchange documentation.

In the example below, the business condition displays error and warning notifications in a Smartsheet and again in the Web UI.

Copy
if (connectionVal == null){
issues.addError("Enter a Connection value.", currentObject, connection);
issues.addWarning("Verify this value based on the Connection value.", currentObject, connectors);
return issues;
}else{
return true;    
}   

The following combined screenshots simultaneously show the associated error and warning messages and how they display upon Smartsheet validation. In reality, these messages only display one at a time depending on the cell you hover over / are in.

The 'Next error' button navigates users to each error or warning cell throughout the sheet, which is extremely useful when dealing with larger data sets.

The Web UI messages are shown on a Node Details screen using a Node Editor component, under the relevant attributes, as a notification box at the top of the screen with a link to the Notifications panel. Use the 'Click to see details' link to display the Notifications panel or click the bell icon at the top of the Web UI screen.

Reference Examples

The example shown in the screenshot above is configured in the business rule shown below. The numbers displayed in the screenshot are referenced in the description below.

In this configured business action image, consider the following numbered operations:

  1. The Data Issues Report bind is required to bring the message into the Web UI as a warning displaying under the relevant field.

  2. The Reference Type bind is set to the 'Accessory' reference.

  1. The JavaScript variable accRefs = node.getReferences(acc); uses the 'Accessory' reference type set in the 'acc' bind.

  2. The 'addError' method runs if the 'Accessory' reference is 'null' (or 'empty'). The custom message 'There is a missing Product Reference of the type ....' is displayed as a notification of the 'Error' type, which displays a red error icon.

The example below demonstrates how a warning message related to a globally configured reference is displayed on a Node Details screen. When the business condition is triggered, a customized message stating ‘A Customer Account Group must be selected’ appears below the affected field, which is highlighted in orange.