Show Error/Info message on Configurable workspace

Ranjane_Omkar
Kilo Sage

We want to display error/info messages in the Workspace. We tried using addInfoMessage/addErrorMessage, but they only work on one form.

Is there any other functionality that lets us show validation errors—e.g., date validation—in the Workspace, and that can also be dismissed?

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

@Ranjane_Omkar 

where do you wish to show that message?

If it's form then addInfoMessage or addErrorMessage will be fine.

What's your actual business requirement? share some screenshots

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

We are working with the CSM/FSM Configurable Workspace. Our requirement is to display error, info, and validation messages. To achieve this, we created a related-list declarative action that opens a modal for updating the date field (which must fall between the contract start and end dates).

 

When the modal’s submit button is clicked, it triggers the transform-type Data Resource we created, where we perform the date validation. We added an addErrorMessage() in the Data Resource script, but the error message only appears on the parent table.

 

We have three tables—SOF, Line, and SCF—and the Line table appears as a related list on both SOF and SCF records. When we invoke the related-list action from the SOF form, addErrorMessage() displays correctly. However, when we invoke the same action from the SCF form’s related list, the message still appears on the SOF form, even though the action originated from the SCF form.

 

We also configured the alert component, but its dismiss button does not clear the alert.

 

Ranjane_Omkar_0-1748597836514.png

 

 

@Ranjane_Omkar 

If you share in detail what you created, where & how, we can try to replicate it and then see if some workaround can be explored

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Declarative action

Ranjane_Omkar_0-1748599279575.png

 

Transform data resource

Ranjane_Omkar_1-1748599445962.png

 

Modal

Ranjane_Omkar_2-1748599493190.png

 

This requirement is too large to explain in detail, so only the basic completed steps are summarized below:

Three task-extended tables have been created:

1. Service Order
2. Order Line
3. Service Change

The **Order Line** table has a **date** field and a **parent** field referencing the **Service Order**. The **Service Change** table also has a **parent** field referencing the **Service Order**. There is no direct relationship between **Service Change** (SCF) and **Order Line**, so a scripted relationship has been created to display Order Line items as a related list on the SCF form.

To update the **date** field on Order Line through the related list, a **related list declarative action** with a **UFX client script** has been created. This script retrieves the selected record `sys_ids` using the related list checkboxes. The declarative action opens a **modal**, where a **date component** is used to select the new date. Once the **Submit** button is clicked, the selected **date value** and **record sys_ids** are stored in the **client state parameters**.

A **transform-type Data Resource** is also created with inputs like **date**, **record sys_id**, and other necessary fields. When the Submit button is clicked, this Data Resource is triggered to update the Order Line record. If the date does not meet the validation criteria, the update is skipped. The transform Data Resource does not return any output.

 

We also tried using the UI Builder Alert component, but the alert box is not dismissible and remains visible at all times. If you have any suggestions on how to configure the alert box to be dismissible, that would be appreciated. Below are the screenshot.

Ranjane_Omkar_0-1748601130908.pngRanjane_Omkar_1-1748601146822.png