How do you determine view from UI action?

geek1
Kilo Contributor

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();

}

2 REPLIES 2

erik_brostrom
Mega Guru

maybe something like this would work...



document.getElementById('sysparm_view') != 'state_close'




No idea if it would work, but just a idea..


amadosierra
Kilo Guru

Use the following in the UI condition:



RP.getViewManager().getViewName() == 'view_name'



If the default view, the function will return blank.