How to add hyperlink for g_form.showFieldMsg display message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2023 07:57 AM
Hi all,
I'm trying to add a hyperlink for g_form.showFieldMsg which redirects to a portal. I have seen in the community it is not possible for showfiledMsg. client is expecting only display message they are not okay to add it as an info message
Could anyone suggest the best alternative ways to achieve this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 07:49 AM
@poornima batchu , in that case you have explain to client about the limitation or go with alternate options, there is no other way, you can open a case with ServiceNow Support for client reference.
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2023 08:29 AM
Hi @poornima batchu ,
I can recomend to build the element from 0, there is a example to redirect to the /esc below the cmdb_ci field in the incident table, i use a client script onLoad:
function onLoad() {
var existingElement = document.getElementById("element.incident.cmdb_ci");
// Create a new anchor (a) tag
var anchorTag = document.createElement("a");
// Set the href attribute for the anchor tag
anchorTag.href = "/esc";
// Set the text content for the anchor tag
anchorTag.textContent = "Employee Portal";
// Set the style for the anchor tag
anchorTag.style.textDecoration = "none";
anchorTag.style.color = "#000";
anchorTag.style.display = "block";
anchorTag.style.padding = "10px";
anchorTag.style.borderRadius = "5px";
anchorTag.style.textAlign = "center";
// Insert the new anchor tag after the existing element
existingElement.insertAdjacentElement('afterend', anchorTag);
}
Just make sure have the "Isolate Script" field turn to off and you can add the styles manually.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 07:47 AM
@Marco0o1 , i tried but it giving me Java Script error , seems like DOM parsing issue.
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution