Alert in CSM workspace that cannot be dismissed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
Hi All,
I am looking to create an alert that cannot be dismissed by the user. This alert needs to be shown in CSM/FSM configurable workspace, if one of the fields on the Case form is not empty. I have tried using the Alert component in UI builder on the Record Default page, but I am unable to manipulate the visibility based on a form field value(it seems to be common for every record in the page instead of just Case record). I can either hide it for all records or display for all.
Display business rule with UI message does not work either in Workspaces.
I would like to know if there is any other way to achieve this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
In the configure tab on a component there is the Component visibility section. In the hide component select bind data or use scripts and select use script on the top right corner of the modal.
As you have the form component you also have the form controller data resource on the page with default id of record. Using that data resource you can then apply your logic for the field
For example
/**
* @Param {params} params
* @Param {api} params.api
* @Param {TransformApiHelpers} params.helpers
*/
function evaluateProperty({
api,
helpers
}) {
return api.data.record.form.fields.category.value === "inquiry";
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
Thank you for the response.
Just an update about the field is that I am using a reference field and hence I am using data resource to fetch this field. And then I am using the component's visibility condition to manipulate.
In the component visibility I am using this:
/**
* @Param {params} params
* @Param {api} params.api
* @Param {TransformApiHelpers} params.helpers
*/
function evaluateProperty({api, helpers}) {
if(api.data.look_up_a_single_record_1.result.u_anzahl.value < 1){
return true;
}
}
Now the alert always shows for all Case records and is not being controlled by the field value(from the referenced consumer record). Where am I erring?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
Value would contain the sysid for your reference record. If the display value for that reference table is a number, then you'd want the displayValue prop instead of value. And I'd make the type coercion from string to a number explicit as well with Number, parseInt or parseFloat depending on your values along with any other necessary checks.
/**
* @Param {params} params
* @Param {api} params.api
* @Param {TransformApiHelpers} params.helpers
*/
function evaluateProperty({ api, helpers }) {
if (/*for example string to integer conversion*/parseInt(api.data.look_up_a_single_record_1.result.u_anzahl.displayValue) < 1) {
return true;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
Hi @Neel10 ,
I tried your problem it is working fine in my PDI please check below solution
Add a component called "Alert".
Open Action from configuration and change type to none
Result:
Please mark my answer correct and helpful if this works for you
Thanks and Regards,
Sarthak
