Aborting message through UI Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2024 05:39 AM - edited 05-23-2024 05:42 AM
Hi All/ @Sandeep Rajput ,
Actually, want to show abort message when click on "UI Action".
We have called script include from server side, so that we have put condition in UI action condition.
As per script logs are executed but taking wrong record value.
Script include:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2024 05:52 AM - edited 05-23-2024 05:53 AM
Hi @abirakundu23 ,
I checked your code you mention

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2024 09:08 AM
@abirakundu23 Please see if the following works.
var Test = Class.create();
Test.prototype = {
initialize: function() {
},
validation:function(){
var checkstatus = false;
gs.info("Checking issue >>> Line6");
var caserecord = new GlideRecord('sn_hr_core_case');
caserecord.addEncodedQuery('u_test=Yes^active=true');
caserecord.addQuery('sys_id',current.getValue('sys_id'));
gs.info("Checking issue >>> Line9");
caserecord.query();
gs.info('Checking the issue case record');
if(caserecord.next())
{
//var taskrecord = new GlideRecord('sn_hr_core_task');
//taskrecord.addQuery('parent',current.parent.sys_id);
gs.info('Checking the validation issue case record');
var count = 0;
var case_record=caserecord.sys_id;
gs.info('case record:' +case_record);
var task_table = new GlideAggregate('sn_hr_core_task');
var temp = gs.getProperty('sn_hr_core.ValidationTask');
task_table.addEncodedQuery('template='+ temp +'^parent=' + case_record);
task_table.addAggregate('COUNT');
task_table.query();
while (task_table.next()) {
count = task_table.getAggregate('COUNT');
}
gs.info('Count is'+count);
while (task_table.next()) {
if((count == 0 )|| (count !=0 && task_table.state != '3'))
{
gs.info("Checking issue");
current.setAbortAction(true);
gs.addErrorMessage('Testing info');
}
else if(count !=0 && task_table.state == '3'){
current.setAbortAction(false);
}
}
}
},
type: 'Validationrestrict'
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2024 09:44 AM
Hi @Sandeep Rajput ,
I have checked , its not working from this line.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 08:23 AM - edited 05-27-2024 08:26 AM
Hi All,
I am trying to send abort message from "Transfer Case" Workspace Client Script once agent click button.
We have a field called "u_test" is "Yes" & no task is there if click on "Transfer Case" then abort message will be displayed.
OOB UI action Workspace: