- 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 10:29 PM
It looks perfect and it should work fine .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2015 10:37 PM
even though the client script is onLoad , when I try to close the requested item whose tasks are not completed, based on the BR it gives the error message but the fields are going read only because of the state= closed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2015 10:41 PM
State can't be closed because BR is giving error message and current.setAbortAction(true) means ... do not perform update operation and thus previous state should be restored which was not 3.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2015 10:43 PM
Agreed, but its not working, any other options to try?
- 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