How to enable edit and new button in Approvers related list (List control) in Change request when state is New ?

raj99918
Tera Contributor

Hi Team,

How to enable edit and new button in Approvers related list (List control) in Change request when state is New ?

 

Thanks

Raj

1 ACCEPTED SOLUTION

@raj99918 

Out of the box for me both the buttons are omitted

But if you want to show those buttons based on state and type then you can use Omit new condition and Omit edit condition script fields

Those are not on form but you can add those 2 fields from configure form layout

Omit edit condition - true means it will hide; when false it will show

Give sample script below: it should be same in both the places

if(parent.state == '-5' && parent.type == 'normal')
	answer = false;
else
	answer = true;

find_real_file.png

Note: This worked for me. When Change is "New" and Type "Normal" it showed me both the buttons

Output: New & Normal buttons shown

find_real_file.png

Output: New & Emergency; both the buttons hidden

find_real_file.png

Regards
Ankur

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

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Raj,

you need to configure the list control for the related list

please check current configuration

Regards
Ankur

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

Thanks for the reply Ankur. I have checked the current settings Omit New and Omit Edit buttons are in checked but my requirement is like When State is New and Type is Normal at this condition only users can see the Edit button and they can manual add the approvers from that clicking on edit button. How can I achieve it?

 

Thanks

Raj

@raj99918 

Out of the box for me both the buttons are omitted

But if you want to show those buttons based on state and type then you can use Omit new condition and Omit edit condition script fields

Those are not on form but you can add those 2 fields from configure form layout

Omit edit condition - true means it will hide; when false it will show

Give sample script below: it should be same in both the places

if(parent.state == '-5' && parent.type == 'normal')
	answer = false;
else
	answer = true;

find_real_file.png

Note: This worked for me. When Change is "New" and Type "Normal" it showed me both the buttons

Output: New & Normal buttons shown

find_real_file.png

Output: New & Emergency; both the buttons hidden

find_real_file.png

Regards
Ankur

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

Thank you sooo much for your clear explanation @Ankur Bawiskar

it works for me.