How do you determine view from UI action?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2015 01:29 PM
I have a UI action button that loads a dialogue window when closing a particular type of task. It's basically loading a specialized view of it's own form in the new window. With that, it's loading my UI button on the new popup window.
I'm trying to get around that by using getView() in my condition but it's not working. You can see from my sample code below that I'm setting the state_close view on the new window that pops up. The new window is loading the correct view. How do I build the condition to check what view we're in so it doesn't show the button?
Onclick: showForm()
Condition: getView() != 'state_close'
function showForm() {
dialog.setSysID(sysID);
dialog.addParm('sysparm_view', 'state_close');
dialog.addParm('sysparm_form_only', 'true');
dialog.render();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2015 06:45 PM
maybe something like this would work...
document.getElementById('sysparm_view') != 'state_close'
No idea if it would work, but just a idea..

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2016 02:41 AM
Use the following in the UI condition:
RP.getViewManager().getViewName() == 'view_name'
If the default view, the function will return blank.