- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2019 11:59 AM
Hello team,
We have UI Action"Submit form" for on scoped app which is working fine on the form, but I want this to be work on list view, I have checked List choice. It is showing up there but not working.
Regards,
Ash
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2019 06:28 AM
Hi Nitin,
I have got the resolution for my question, just unchecked the client on UI action and 2 lines code that resolved my issue. But thanks for the response I will have the above link handy for future reference which will work for global applications.
Regards,
Ash

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2019 12:06 PM
Hi Ash,
If its possible can you please share your UI action?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2019 12:26 PM
Sure,
here is the screenshot
onClick()
{
if(g_form.getValue('status') == 'inital stage') {
var curNo = g_form.getValue('number');
var ga = new GlideAjax('check_dependent_exists');
ga.addParam('sysparm_name','DoesFEExist');
ga.addParam('sysparm_currentNo',curNo);
ga.getXML(FEParse);
function FEParse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
if (answer == 'Not Exist')
else if (answer == 'Exist')
gsftSubmit(null, g_form.getFormElement(), 'submitforms');
}
}
else if(g_form.getValue('status') == 'secont stage' && g_form.getValue('add_margin_fe') =='yes') {
var curNo = g_form.getValue('number');
var ga = new GlideAjax('check_dependent_exists');
ga.addParam('sysparm_name','DoesPOExist');
ga.addParam('sysparm_currentNo',curNo);
ga.getXML(FEParse);
function FEParse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
if (answer == 'Not Exist')
alert('Please select atlease one PO using the "Additional Margin PO Lists" section below');
else if (answer == 'Exist')
gsftSubmit(null, g_form.getFormElement(), 'submitforms');
}
}
else
gsftSubmit(null, g_form.getFormElement(), 'submitforms');
}
if (typeof window == 'undefined')
submitForm();
function submitForm() {
var wfRec = new GlideRecord('sysapproval_approver');
wfRec.addQuery('sysapproval',current.sys_id);
wfRec.addQuery('state','requested');
wfRec.query();
var wfRecStatus = wfRec.next();
if(current.status== "Intial stage" && !(wfRec.next())) {
current.tatus="secont stage";
current.update();
}
else {
var appRec = new GlideRecord('sysapproval_approver');
appRec.addQuery('sysapproval',current.sys_id);
appRec.addQuery('state','requested');
appRec.query();
while(appRec.next()) {
if(gs.hasRole("approval_admin") || (appRec.approver == gs.getUserID())) {
current.approval = 'approved';
current.update();
appRec.setValue('state','approved');
appRec.update();
break;
}
}
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2019 01:06 PM
So I think g_form object will not work on list choice option of UI action. Because in List view user will select multiple record to perform the action, and in your UI action you are getting value from current form using g_form object. Check existing Delete UI action
Ref:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2019 05:05 AM
Hi Nitin,
So, do I need create on more UI Action for submit form? in my case we are using existing UI on Form does this won't work?
Regards,
Ash