
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2017 08:10 AM
I have the below script that is currently not working. I need to hide the "Complete Task" button if the state changes to any of the following. "-940", "-941", "-942", "-943". Can someone help me correct this script?
function onChange(){
//If the incident type is 1,2,3
}
showCloseTaskButton('Convert to Request');
function showCloseTaskButton(button) {
if(g_form.getValue('state' == -940) || g_form.getValue('state' == -941 || g_form.getValue('state' == -942) || g_form.getValue('state' == -943)){
//show the 'Convert to Request'
var items = $$('BUTTON').each(function(item){
if(item.innerHTML.indexOf('Complete Task') > -1){
item.show();
}
});
} }
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2017 01:55 AM
Hi Edwin,
if you want to make your ui action visibility based on dropdown values then you can try with UI Policy.
refer the screenshot below. i tested with category values. button will be visible based on category values.
Script :
function onCondition() {
$$('#awc_test')[0].show();
}
******************
function onCondition() {
$$('#awc_test')[0].hide();
}
Hope it will help you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2017 09:36 AM
I received the same error mentioned above, but I'm thinking it might be because my app is a scoped app/ scoped table and not global

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2017 10:14 AM
No Problem.
there is another solution for it.
follow the steps below.
- create one properties . Click on new button then it will open a form.
- Enter the suffix "glide.script.block.client.globals" and type is true|false, value is false.
now the script will work.
Let me know if you have any question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2017 10:41 AM
Perfect, perfect, perfect!! That got it working, thank you so much for your help.