UI Action to Save and Run UI Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2016 07:43 AM
I created a custom table with a custom form and now I want to combine two ui actions into one. I have the "Save" UI Action and "Make Card" UI Action which runs a UI Page.
Save:
and Make Card:
What I want to have happen is I want it to first save and then run the ui page to display the Card all in the same ui action so they don't have to click two buttons to do this.
Any ideas on how to combine these?
I tried pasting the script from the save ui action into the function of the make card ui action and fiddling with it like that, but to no avail.
Any help would be greatly appreciated. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2016 07:44 AM
just have g_form.save() before you have the code to open ui page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2016 07:55 AM
So I tried this and it didn't do anything:
-----------------------------------------------------------------------------------------------------------------------------------------------
g_form.save(); |
function DivTest() {
var features = "resizable=yes,scrollbars=yes,status=yes,toolbar=no,menubar=yes,location=no";
var href = [];
href.push('sysparm_id=' + gel('sys_uniqueValue').value);
win = window.open("/div_test.do?sysparm_stack=no&" + href.join("&"), "Printer_friendly_format", features);
win.focus();
return false;
}
-----------------------------------------------------------------------------------------------------------------------------------------------
Then I tried these and it created the ui page BEFORE saving, which meant all the variable on my form that i need to populate the ui page were blank. So i need it to save before popping up the ui page....
-----------------------------------------------------------------------------------------------------------------------------------------------
function DivTest() {
var features = "resizable=yes,scrollbars=yes,status=yes,toolbar=no,menubar=yes,location=no";
var href = [];
href.push('sysparm_id=' + gel('sys_uniqueValue').value);
g_form.save();
win = window.open("/div_test.do?sysparm_stack=no&" + href.join("&"), "Printer_friendly_format", features);
win.focus();
return false;
}
-----------------------------------------------------------------------------------------------------------------------------------------------
function DivTest() {
g_form.save();
var features = "resizable=yes,scrollbars=yes,status=yes,toolbar=no,menubar=yes,location=no";
var href = [];
href.push('sysparm_id=' + gel('sys_uniqueValue').value);
win = window.open("/div_test.do?sysparm_stack=no&" + href.join("&"), "Printer_friendly_format", features);
win.focus();
return false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2016 07:57 AM
try this
g_form.save();
DivTest();
function DivTest() {
var features = "resizable=yes,scrollbars=yes,status=yes,toolbar=no,menubar=yes,location=no";
var href = [];
href.push('sysparm_id=' + gel('sys_uniqueValue').value);
win = window.open("/div_test.do?sysparm_stack=no&" + href.join("&"), "Printer_friendly_format", features);
win.focus();
return false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2016 08:02 AM
That just popped up the ui page and didn't save the form before or after.