Hide edit button

Shabbir1
Tera Contributor

Hi team,

 

on problem we have a field region drop down (1usa  2 Europe) and in related list we have "change requests" in that we have "add: and "edit" buttons we need to hide the edit button when region is USA and show when region is Europe can anyone suggest how to achieve this i have uncheck the "omit edit button" and added the script in "omit edit condition" sharing script but it is not working

 

if (current.region=="europe"){

answer = true;

}

else{

answer=false;

}

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Shabbir1 

do this in script in Omit Edit Condition script field

If that field is not on form then add it

give the correct field name and choice value

if (parent.region == "usa"){
answer = true; // this means omit
}
else{
answer=false; // this means show
}

AnkurBawiskar_0-1742466312670.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

2 REPLIES 2

Nilesh Pol
Tera Guru

Hi @Shabbir1 

Script you mension is corrent, Can you verify with clearing cache once?

also you can debug what region is returning the value by using: gs.info("Region value: " + current.region);

 

Ankur Bawiskar
Tera Patron
Tera Patron

@Shabbir1 

do this in script in Omit Edit Condition script field

If that field is not on form then add it

give the correct field name and choice value

if (parent.region == "usa"){
answer = true; // this means omit
}
else{
answer=false; // this means show
}

AnkurBawiskar_0-1742466312670.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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