UI Action to Save and Run UI Page

alexcharleswort
Tera Expert

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:

save.PNG

and Make Card:

card.PNG

card 2.PNG

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!

6 REPLIES 6

Anurag Tripathi
Mega Patron
Mega Patron

just have g_form.save() before you have the code to open ui page


-Anurag

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;


}


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;


}


-Anurag

That just popped up the ui page and didn't save the form before or after.