- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2024 02:31 AM
Hi Every one,
when i click the cancel UI action an Active SIR record without providing work notes
in that Cancel UI action i have created the scripts to populated the error message, the error message is shown but it's gone when the page is fully completely loaded, I want a warning message banner should appear on top of form and stay there after page is completely loaded, below is the UI script, any suggestion please.
if (current.work_notes == "") {
gs.addErrorMessage("Worknotes mandatory. Please write cancellation reason in the worknotes.");
//action.setRedirectURL(current);
}else {
var wf = new global.Workflow();
wf.cancel(current);
current.state = 7;
current.update();
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2024 04:56 AM
Hi @DeepikaR1661877 ,
Please try the below code:
function errorOnEmptyWorkNote() {
if (g_form.getValue('work_notes') == "") {
g_form.addErrorMessage("Worknotes mandatory. Please write cancellation reason in the worknotes.");
return false;
}
gsftSubmit(null, g_form.getFormElement(), 'cancel_action');
}
if (typeof window == 'undefined')
Cancel();
function Cancel() {
var wf = new global.Workflow();
wf.cancel(current);
current.state = 7;
current.update();
}
If you find this helpful, please mark as Correct or Helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2024 10:22 PM
Hi @Sherin Jenifer ,
Yeah, it's working, thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2024 08:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2024 08:19 AM
If you find this helpful, please mark as Correct or Helpful.