Hiding a column in a Related List completely

Matt Cordero1
Tera Guru

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.

MattCordero1_1-1748180181911.png

 

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.

 

2 REPLIES 2

pratikjagtap
Giga Guru

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:
  1. Go to the parent table's form layout.
  2. Scroll down to the Related Lists.
  3. Click on the gear icon next to the related list you're targeting.
  4. Configure → Related List Layout.
  5. Remove the pricing columns (Orig. Price, % Discount, etc.) from the selected columns list.
  6. 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

Robert H
Mega Sage

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.

 

RobertH_0-1748192314892.png

 

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.

 

RobertH_1-1748192898894.png

RobertH_2-1748192935996.png

 

Regards,

Robert