remove the delete option under the three dots when we open any portfolio plan

shraddha14
Tera Contributor

I want to remove the delete option under the three dots menu which is introduced as part of the new feature of the Washington release as this would delete the original item.

 

Steps to reproduce:

1. Open strategic planning workspace, open any portfolio plan

2.Under the planning tab select the  prioritization tab

3. when you click on context menu(three dots) you can see delete demand, or delete project option based on the planning item type 

I want to remove this  "Delete  Project "  or " Delete Demand " option 

 

Your help is appreciated

 

 

3 REPLIES 3

Prashant_S
ServiceNow Employee
ServiceNow Employee

@shraddha14  This delete option only deletes the planning item and doesnt delete the execution or original item.

If you still want to remove the delete option, you need to do some code changes. 

SasankaV
Giga Guru

Hi @shraddha14, I think I faced a similar use case in my experience with Work4flow. Give the below steps a try:

  • Log in to your ServiceNow instance.
  • Navigate to the "Strategic Planning Workspace."
  • Open any portfolio plan.
  • Go to the "Planning" tab and select the "Prioritization" tab.
  • Identify the context menu (three dots) where the "Delete Project" or "Delete Demand" option appears.
  • Go to "System Definition" > "UI Actions."
  • Search for the UI actions related to "Delete Project" or "Delete Demand."
  • Open the relevant UI action record.
  • Update the "Condition" field to ensure it does not display the delete option in the desired context.
  • Save the changes.
  • Return to the "Strategic Planning Workspace."

  • Open a portfolio plan and check if the delete option is no longer available under the three dots menu.

  • Navigate to "System UI" > "Client Scripts."

  • Create a new Client Script for the relevant form.

  • Use a script to hide the delete option based on specific conditions.

(function() {
  // Ensure the script runs only on the desired forms
  if (g_form.getTableName() == 'desired_table_name') {
    // Hide the delete button
    g_form.removeOption('delete_option_name');
  }
})();
  • Save and activate the Client Script.

Let me know if it doesn't work. I'll be happy to assist.

jrijpstra
Tera Contributor

Did you manage to get an answer?