Add annotation or info message to a related list tab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2023 07:32 AM
I'm wanting some advice of adding an annotation or info message to a certain tab within a related list.
In the above example, I'm wanting to add an info message within the 'Related Risks' tab because if those two values don't appear for the current user, then they haven't got the correct access. I was just wondering what I need to do to get that info message showing if the current user hasn't got the correct access.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2023 07:57 AM
HI @matthew_hughes ,
Hope you are doing great.
you can utilize UI Scripts or Client Scripts to add addnotation or info under related list.
1. Create a UI Script or Client Script:
// Define the tab name and related list ID
var tabName = 'tab_name';
var relatedListId = 'related_list_id';
// Retrieve the tab element
var tabElement = document.getElementById(tabName);
// Check if the tab element exists
if (tabElement) {
// Create the info message element
var infoMessage = document.createElement('div');
infoMessage.className = 'info-message';
infoMessage.innerText = 'Your annotation or info message goes here';
// Append the info message element to the tab element
tabElement.appendChild(infoMessage);
// Modify the related list title to make space for the info message
var relatedList = document.getElementById(relatedListId);
if (relatedList) {
relatedList.style.marginTop = '20px'; // Adjust the margin value as needed
}
}
Regards,
Riya Verma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2023 01:02 AM
Hi @Riya Verma Would that be an OnLoad client script