How to omit a new button by setting condition's in omit new condition from a related list?

TechLead_vikas
Tera Contributor

Hi All,

Currently I am using Helsinki version of SNOW, in this version we have a Advanced list control with scripts.

When I am trying to omit a New button of a Related List using script for a Closed state condition, it is hiding for closed state as well as rest of the states.

The thing is, it is hiding in each state otherwise it is visible in each state.

I am using below script, please see the attached screen.

find_real_file.png

Please if you get my issue, let me know the solution.

Thanks,

Vikas Ambulgekar

1 ACCEPTED SOLUTION

veena_kvkk88
Mega Guru

I think you need to give answer; at the end. Like this: (From Helsinki Product Documentation: Advanced list control with scripts )



var answer ;


if (current.u_state=='Closed') { //Do not remove the 'New' button


  answer = false ;


}


else { //Remove the 'New' button


  answer = true ;


}


answer ;



If that doesn't work, use parent object in place of current like said in the doc. I'm not an expert but this is how I would try.


View solution in original post

9 REPLIES 9

Mitisha1
Kilo Contributor

I want to remove the new button from one module but keep it for other 2 modules.

how should i do it?

Hello,

     You can add lint to the existing condition on New UI Action for that particular able 

     <condition>&&(RP.getParameterValue('sysparm_userpref_module') !=sys_id of Module)

 

Regards,

Jagadeesh

Linhart
ServiceNow Employee
ServiceNow Employee

Select the option "Omit New button" to remove the button from module.

 

find_real_file.png

 

A_
Kilo Explorer

where do you go in order to see this screen?  the screen that has the check box, "Omit New Button".

AJ2025
Tera Contributor

In the Continual Improvement Management module, we can create new CIM tasks in the "Review" state. This seems to be an oversight by ServiceNow. We may be able to use above method to remove the "New" button in the Review state. Just thought I should let everyone know.