Hiding a column in a Related List completely
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2025 06:39 AM
Hello all,
Is there a way to way to hide/prevent a column from appearing within a Related List. I can prevent the column's data from appearing with ACLs, but the column itself still appears.
I have tried creating a View Rule to force a view with "No Pricing" columns, but the view only gets activated after clicking on one of the Related List's items. Not when loading the Related List initially.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2025 09:14 AM
Hi @Matt Cordero1 ,
Follow the below steps for best practices
1. Customize the Related List Layout (per view)
You can manually control which columns appear per related list view:
- Steps:
- Go to the parent table's form layout.
- Scroll down to the Related Lists.
- Click on the gear icon next to the related list you're targeting.
- Configure → Related List Layout.
- Remove the pricing columns (Orig. Price, % Discount, etc.) from the selected columns list.
- Save.
2.Create a Custom View with Role-Based Control
If you want to conditionally show/hide columns based on role, create a custom view:
- Go to the child table (e.g., Line Items).
- Create a new View like "No Pricing".
- Configure the List Layout for that view, excluding the pricing columns.
- Create a UI Policy or Client Script to redirect certain roles to the "No Pricing" view on form load.
- Unfortunately, related lists default to the form’s view.
- But you can work around this using scripting (see below).
3.Use GlideRelatedList Script Include Override (Advanced)
For advanced control over related list rendering, you can override GlideRelatedList behaviors via scripting.
- You’d have to:
- Extend the Script Include that controls list generation.
- Programmatically remove or suppress fields from the ListLayout dynamically.
⚠️ Not officially documented and may break on upgrades — not recommended unless you're doing scoped apps with strict version control.
4.Hide Columns with Client Script + DOM Manipulation (UI Hack)
As a last resort, you can hide the column headers + cells with DOM manipulation.
Example Client Script (UI Type: All):
function onLoad() {
if (g_form.getViewName() == 'default') {
// Delay to let the related list render
setTimeout(function () {
// Adjust based on the related list's table name and column index
const columnHeaders = document.querySelectorAll("th span[title='Orig. Price']");
columnHeaders.forEach(el => el.closest("th").style.display = "none");
const colIndex = Array.from(document.querySelectorAll("th")).findIndex(
th => th.innerText.trim() === 'Orig. Price'
);
if (colIndex > -1) {
document.querySelectorAll("table.list_table tbody tr").forEach(row => {
let cells = row.querySelectorAll("td");
if (cells[colIndex]) {
cells[colIndex].style.display = "none";
}
});
}
}, 1500);
}
}
If my response helped, please hit the 👍Thumb Icon and accept the solution so that it benefits future readers.
Regards,
Pratik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2025 10:09 AM - edited 05-25-2025 10:10 AM
Hello @Matt Cordero1 ,
A View Rule only applies only to forms because its condition is based on the attributes of the particular record being viewed.
You can remove a field from a Related List by configuring its List Layout.
If you want to hide that field in a particular View then please change the Form View first before configuring the related list layout.
Each View has its own related list configuration.
Regards,
Robert