on submit client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago - last edited 4 hours ago
Hi All,
if some tries to resolve (using an Ui action) the problem record and if there are open problem task records, I want to restrict that and keep the state in fix in progress state only.
I am trying this using on submit client script and not business rule because when I try to resolve it state will temporarily move to resolve state but when I refresh it, it will move back to fix in progress. and I don't want that. nor did the client.
so here is the script below -
client script - on submit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
its OOTB so could not make any updates in it ..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago - last edited 2 hours ago
as I made some changes to the script and it worked but
my screen got freez when i click on resolve ( hopefully it did not move forward )
as shown below
why is that ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi @tushar_ghadage ,
OnSubmit client script is not going to work here you need to use business rule or update the UI Action.
Create a before business rule.
Use the below script:
(function executeRule(current, previous /*null when async*/ ) {
var isPTaskExist = false;
var grPTask = new GlideRecord('problem_task');
grPTask.addQuery('problem', current.getUniqueValue());
grPTask.addActiveQuery();
grPTask.setLimit(1);
grPTask.query();
if (grPTask.hasNext()) {
isPTaskExist = true;
}
if (isPTaskExist) {
gs.addErrorMessage(gs.getMessage("There are active problem task related to the problem. Please close them before closing this problem"));
gs.setRedirectURL(current);
current.setAbortAction(true);
}
})(current, previous);
You can also update the Resolve button condition to call your script include.
Thanks
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
hide the Resolve UI Action when open tasks exist
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago - last edited 2 hours ago
it's the OOTB Ui action and with the business rule i am facing an issue as i mentioned above where state will move to resolve and then after reloading the state will move back to fix in progress
( also i tried with script as well its happening the same too here also ) i want to keep the state on the fix in progress it self and not move ahead to resolve at all .. if there are multiple ptask open ..
