- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2020 03:24 PM
Hello,
I have a UI action button and when it is clicked it asks the user for confirmation about closing a record (see pics below).
For some reason when I click 'Ok' on the confirmation, nothing happens. Is my code off?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2020 03:16 PM
I modified the code slightly and this worked:
function closeRecord() {
var answer = confirm("Are you sure you want to close this candidate record?");
if (answer == true) {
gsftSubmit(null, g_form.getFormElement(), "ACTION_NAME");
}
if (answer == false) {
return false;
}
}
if (typeof window == 'undefined') {
UpdateStatus();
}
function UpdateStatus() {
current.status = "closed_no_interest";
current.update();
action.setRedirectURL(current);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2020 04:28 PM
//You have set this ui action to run as a client side. Current object will not work in the function. There will be two part for this UI action. One client side and another serve side.
//When you will click on the ui aciton it will execute the function and then the other part of this Ui action See the code below.
function closeRecord(){
var answer = confirm("Are you sure you want to close this candidate record?");
if(answer == true)
gsftSubmit(null, g_form.getFormElement(), ACTION_NAME); // add action name to your ui aciton and put here.
}// close function
if(typeof window == 'undefined')
UpdateStatus();
function UpdateStatus(){
current.status = "closed_no_interest ";
//Update and reload the record
action.setRedirectURL(current);
current.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2020 07:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2020 07:59 AM
I tried this on my incident table and it does work. (i changed the state value)
is the value of status the text value you entered? (and not an integer)
is the field name status? no prefix?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2020 08:25 AM