Heatmap Visualization - Event handler in Ui Builder
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
I have created a heatmap in ui builder .
when i clicked a cell in the heatmap, its not redirecting to the record page.
this the script i have used
/**
* @Param {params} params
* @Param {api} params.api
* @Param {any} params.event
* @Param {any} params.imports
* @Param {ApiHelpers} params.helpers
*/
async function handler({
api,
event,
helpers,
imports
}) {
const title = event.payload.title;
var queryObj = event.payload.params.url;
// converting the following query
// "sn_risk_risk_list.do?sysparm_query=impact%3De1d1c772d7030200bbc783e80e610364%5Elikelihood%3Dfc318772d7030200bbc783e80e6103d8"
// to
// impact=e1d1c772d7030200bbc783e80e610364^likelihood=fc318772d7030200bbc783e80e6103d8
queryObj = queryObj.split("sysparm_query=").pop();
queryObj = queryObj.replaceAll("%3D", "=");
queryObj = queryObj.replaceAll("%5E", "^");
const listTitle = await helpers.translate("Risks");
queryObj = queryObj + "^state!=retired";
const payload = {
fields: {
"table": "sn_risk_risk"
},
params: {
"query": queryObj,
"listTitle": listTitle
},
title,
route: "simplelist"
};
api.emit("NAV_ITEM_SELECTED", payload);
}
Labels:
- Labels:
-
Risk Management
0 REPLIES 0