- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2021 04:02 AM
I have a UI Action which does a confirm before force closing a table record but I'd like to replace the confirm with a prompt, asking the user to enter a comment for force closure, but can't seem to get the prompt input into the comment, it shows as null
function rma_complete(){ // Same as OnClick
var reason=prompt("Enter reason for force closure this request");
if (reason!="")
{
gsftSubmit(null, g_form.getFormElement(), 'rmaclose');
}
else
{
return false;
}
}
//Code that runs without 'onclick'
//Ensure call to server-side function with no browser errors
if(typeof window == 'undefined')
rmagotocls();//change to next stage
function rmagotocls(){ //change to next stage, same as above
current.work_notes = gs.getUser().getFirstName() + " " + gs.getUser().getLastName() + " has force closed this request from the '" + current.state.getDisplayValue() + "' state, reason: " + reason;
current.state = 300;
current.update();
action.setRedirectURL(current);
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2021 04:39 AM
Check sample code for refernce
function rma_complete() { // Same as OnClick
var reason = prompt("Enter reason for force closure this request");
if (reason != " ") {
g_form.setValue('comments', g_user.firstName + " " +reason);
gsftSubmit(null, g_form.getFormElement(), 'rmaclose');
} else {
return false;
}
}
//Code that runs without 'onclick'
//Ensure call to server-side function with no browser errors
if (typeof window == 'undefined')
rmagotocls(); //change to next stage
function rmagotocls() { //change to next stage, same as above
//current.comments = "reason: " + reason;
current.description = 'hello.testing';
current.update();
action.setRedirectURL(current);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2021 04:16 AM
Hi davie
I think you are trying to access "reason" variable which is in another function
Use setValue to set the reason.
Check this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2021 04:39 AM
Check sample code for refernce
function rma_complete() { // Same as OnClick
var reason = prompt("Enter reason for force closure this request");
if (reason != " ") {
g_form.setValue('comments', g_user.firstName + " " +reason);
gsftSubmit(null, g_form.getFormElement(), 'rmaclose');
} else {
return false;
}
}
//Code that runs without 'onclick'
//Ensure call to server-side function with no browser errors
if (typeof window == 'undefined')
rmagotocls(); //change to next stage
function rmagotocls() { //change to next stage, same as above
//current.comments = "reason: " + reason;
current.description = 'hello.testing';
current.update();
action.setRedirectURL(current);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2021 05:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2023 06:18 PM
@Voona Rohila hello I has a problem, the prompt Can I set required input items?