UI page process scripts

If your UI page contains a form (uses the <g:form> tag), you can submit the form and have the process script run.

The processing script can naturally access fields on the form. For example, if your form contained the application_sys_id field:
<g:ui_form><p>Click OK to run the processing script.</p> <g:dialog_buttons_ok_cancel ok = "return true"/> <input type = "hidden" name = "application_sys_id" value = "499836460a0a0b1700003e7ad950b5da"/> </g:ui_form>
You could then access it using just application_sys_id:
Note:
var application = new GlideRecord('hr_application');
 application.get(application_sys_id);
 application.status = "Rejected";
 application.update();
 var urlOnStack = GlideSession.get().getStack().bottom();
 response.sendRedirect(urlOnStack);

If you are using the UI page for a dialog, you can also reference the most recent URL on the stack using the code above and then send the response to that location. This is useful if you want to have the dialog's processing script update something and then redisplay the screen that brought up the dialog.