
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2015 10:45 AM
I have having some trouble here... I am fairly new to scripting and I am trying to save the form on load because they script is bringing new reference fields into the form for the people working the task but without saving it at least once when you open the task, it asks you to save every time before navtigating away from the page. Everything in the script is working except the Save of the form. What am I missing?
function onCondition() {
var item = $("current_item");
var guide = $("sysparm_guide");
if (item != null && guide != null && item.value == guide.value)
return;
g_form.setMandatory('emp_start_date',true);
g_form.setMandatory('employee_name',true);
g_form.setDisplay('employee_number',false);
g_form.setDisplay('department',false);
g_form.setDisplay('job_class',false);
g_form.setDisplay('ad_id',false);
g_form.setDisplay('job_code',false);
g_form.save();
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2015 12:01 PM
If you're on a catalog task form, you can use the following line to save the form.
gsftSubmit(gel('sysverb_update_and_stay'));

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2015 12:01 PM
If you're on a catalog task form, you can use the following line to save the form.
gsftSubmit(gel('sysverb_update_and_stay'));

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2015 01:14 PM
Thanks, that worked!