- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2016 02:55 AM
Hi Experts,
I have written this code but it is not able to run can you please suggest what to do any update on below code. please suggest
No error No warnings.
still not able to run. please suggest.
Solved! Go to Solution.
- Labels:
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2016 03:20 AM
Hi Amol,
Search for the ui action that you want to hide.
Open it, you will find condition field in it. You can mention your condition for the visibility of that ui action there.
Below is the snapshot for reference.
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2016 06:03 AM
Hi!
I tried my best but can't quite get there.
UI Action Condition: gs.hasRole('itil') && !new ChangeRequestStateHandler(current).isOnHold() && new ChangeRequestStateHandler(current).isNext("closed") && ChangeTasks.activeTasks('false')
Script include name: ChangeTasks
Accessible from: All application scopes
Active: Yes
Script:
var ChangeTasks = Class.create();
ChangeTasks.prototype = {
activeTasks: function() {
var chg = new GlideRecord('change_request');
var tsk = new GlideRecord('change_task');
chg.get(current.sys_id);
tsk.addAggregate('COUNT');
tsk.addQuery('change_request',current.sysid);
tsk.addActiveQuery();
tsk.query();
var count = 0;
if (tsk.next()){
count = tsk.getAggregate('COUNT');
}
if (state == 0 && type == 'emergency' && count > 0){
return true;
}
else {
return false;
}
},
type: 'ChangeTasks'
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2016 01:58 PM
let me just throw down a quick example.
I only only want this UI Action to be visible if the incident doesn't have any active incident childs
UI Action condition: getChildInfo(current.sys_id);
Script include:
now this UI actions hides if the incident have any active childs and shows if it doesn't have any.
//Göran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-25-2016 04:47 AM
I tried but this is not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2016 03:21 AM
Yes UI Action is the best way to do this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2016 03:32 AM
Thank you so much guys. It is working now and its working fine.
thank you so much all for your help