- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2015 09:04 PM
Hello All,
we have a scenario where user should not be able to close requested item until and unless all the tasks related to that requested item are closed,
for the same there is a before update business rule as below.
var rec = new GlideRecord('sc_task');
rec.addQuery('request_item',current.sys_id);
rec.addQuery('state','!=',3);
rec.query();
if(rec.next())
{
gs.addErrorMessage('Please close all the tasks before closing the requested item');
current.setAbortAction(true);
There is client script when status is closed all the fields will be made read only.
So the issue here is when user changes the status to close in requested item and updates it , it gives invalid update based on the above BR, and all the fields are greyed out because of the client script,
But actually the transaction is not complete (i.e. the requested item is still open), which user comes to know when he reloads or refresh the form which is actually mis-leading.
please let me know what are the modifications to be done.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2015 10:47 PM
It seems like setAbortAction is not working . Following thread may help you a little
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2015 11:21 PM
Strange but seems to be working,
have set current.stage = previous.stage instead of setabortaction.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2015 11:10 PM
Hi,
Just add one line at the end of BR like "gs.setRedirect(current);".
Try and lemme knw if u face any issue.
Thanks,
Alex