- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2016 10:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 02:56 AM
Okay perfect,
Here is a screenshot that shows the parameters of the UI action, Please do the same
Do not forget to put the action name, check client to true, and put the function name on Onclick()
HEre is the script :
function reopenIncidentTest(){
if (g_form.getValue('comments') == '') {
//Remove any existing field message, set comments mandatory, and show a new field message
try {
g_form.hideFieldMsg('comments');
} catch(e) {}
g_form.setMandatory('comments', true);
g_form.showFieldMsg('comments','Reason is required when reopening an incident','error');
return false; //Abort submission
}
//Call the UI Action and skip the 'onclick' function
gsftSubmit(null, g_form.getFormElement(), 'incident_reopen_test'); //MUST call the 'Action name' set in this UI Action
}
//Code that runs without 'onclick'
//Ensure call to server-side function with no browser errors
if (typeof window == 'undefined')
serverReject();
function serverReject(){
current.state = 2;
current.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 03:37 AM
Sandeep,
I found that Zic in his latest reply left out this line (though not intentionally) : action.setRedirectURL(current);
You have to use this line to be redirected to the current incident you want to reopen. See the position of the line in my code and place this to achieve your desired result.
Thanks,
Arnab
Please mark Correct/Helpful according to the worthiness of my solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 03:55 AM
Hi Arnab I have tried this but still it is opening the new incident not the existing one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 04:02 AM
What exact lu You mean by it is opening a new incident ? You mean by while clicking on that button, another incident is getting updated ? Or it is redirecting you to another resolved incident ?
Let's say take the resolved incident INC00001, fill out the Comment field, click on that reopen incident button and what's happening ?
If you search INC00001 within your incident list, what is the state ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 02:56 AM
Okay perfect,
Here is a screenshot that shows the parameters of the UI action, Please do the same
Do not forget to put the action name, check client to true, and put the function name on Onclick()
HEre is the script :
function reopenIncidentTest(){
if (g_form.getValue('comments') == '') {
//Remove any existing field message, set comments mandatory, and show a new field message
try {
g_form.hideFieldMsg('comments');
} catch(e) {}
g_form.setMandatory('comments', true);
g_form.showFieldMsg('comments','Reason is required when reopening an incident','error');
return false; //Abort submission
}
//Call the UI Action and skip the 'onclick' function
gsftSubmit(null, g_form.getFormElement(), 'incident_reopen_test'); //MUST call the 'Action name' set in this UI Action
}
//Code that runs without 'onclick'
//Ensure call to server-side function with no browser errors
if (typeof window == 'undefined')
serverReject();
function serverReject(){
current.state = 2;
current.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 03:21 AM
thak you Zic...!!
i am not feeling Shy ..
i have implemented your code ..but when i am clicking that button its opening new incident not the same with changing state to Active..