g_form.getValue('state') not working in catalog client onSubmit() script through ServicePortal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2020 09:48 AM
We are trying to use an onSubmit() client script to return the value of the state of the task and it returns empty when running through the service portal.
Just create an onsubmit() script against a catalog task record.
ui type = all
isolate script =false
function onSubmit() {
g_form.addInfoMessage("Action:"+g_form.getActionName());
g_form.addInfoMessage("State:"+g_form.getValue('state'));
}
The first message returns the action name, but the second message returns empty.
Anyone have ideas on how to make this work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2020 11:09 AM
Probably it's a typing error only. Why you use
g_form.getValue('assigned_to')
if you need return the state (not assigned_to value)? Try to use
g_form.addInfoMessage("State:"+g_form.getValue('state'));

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2020 11:29 AM
Sorry my example didn't match the subject. But, it doesn't really matter because neither of the options actually work.