Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

HIDE UI Action in Project Workspace.

monishsnowd
Tera Contributor

Hi All,

I’ve created a UI Action called “Move to Planning” on the pm_project table. However, I need this action to be hidden specifically when viewing the Planning tab in Project Workspace. I’ve tried implementing this through a client script but haven’t had any success so far. Has anyone encountered a similar scenario and found a workable solution?

 

CLIENT SCRIPT -

function onLoad() {
    alert('INSIDE CS');
    var url = window.location.href.toLowerCase(); // normalize case
    alert('URL is: ' + url);

    if (url.includes('planning') && url.includes('pm_project')) {
        alert('INSIDE URL condition');

        // Try to find the UI Action by its data-action-name
        var uiActionElement = document.querySelector('[data-action-name="move_to_planning"]');

        if (uiActionElement) {
            uiActionElement.style.display = "none";
            alert('UI Action hidden');
        } else {
            alert('UI Action element not found in DOM');
        }
    }
}
2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@monishsnowd 

share screenshots please

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

HarshR158979806
Tera Expert

Hi @monishsnowd 

I was also stuck in the same problem, and now I found a solution to it.

You have to exclude the UI action Visibility from the "Move Project View", 

Reason: "planning" tab view is "Move project" , so we need to remove the ui action from this view

HarshR158979806_1-1762017649569.png

 



Steps:
1.) Go to the "Move to planning" ui action record and you will find the "UI action visibility" related list on that record

refer below screenshot

HarshR158979806_0-1762017331601.png

 

Mark my answer Helpful 👍, if it helps you

Thank you,
Harsh Raghav