Can I apply a UI Policy to only the default view?

Marcel H_
Tera Guru

I am trying to figure out if there is a good way to apply a UI Policy to only the default view on a table. Currently I am working with a custom table extended from Task.

I have several views and view rules set up to display fields on the form based on the Assignment Group, since each group has their own form layout that they require, and the number of UI Policies to control that was getting very large. However there is a specific case where two of these groups check a queue of new items that aren't assigned to any group, and the default view is showing them a very basic layout. They would like to see the appropriate fields for their group when the Assignment Group is set (saving the record so that the view rule kicks in is too much effort).

My first thought was to use UI Policies (since this is a limited case and shouldn't lead to more and more UI Policies) that display the appropriate fields when the value of Assignment Group is set to either of the two groups, but don't want the UI Policies for this to run on any of the other views, since this would be redundant. I unchecked the Global box on the UI Policy form so that I could select a view, but the default view isn't an option, only the other views that I created for the table. Is this normal behavior? If I apply a global UI Policy, do I need to worry about it affecting the other views, since the tooltip for Global says "UI Policy applies to all form views"?

4 REPLIES 4

Prateek kumar
Mega Sage

Uncheck global and Select your view

find_real_file.png

 


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

That's part of the problem, when I do that, the default view isn't listed as an option to specifically select, only the views that I created myself on that table.

How about write some script and get the view name?

function onLoad() {  
    //Type appropriate comment here, and begin script below  
    var view = getView();  
  if (view != 'default'){   //self service view name is ess so make to ess
  g_form.setValue('state','2');  
  }  
}  

find_real_file.png


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

Brent Langdon
Tera Contributor

Following up on an old question because this is what turned up when I was searching for an answer on this topic.

I went down the script path.  I found that the return from getView() when the Default View is selected is not 'default' but is '' (blank).  That made me wonder...

I found that if I 1) uncheck the Global option then 2) do NOT select a View (leave that field blank) then the UI Policy will only run for the Default View.  I was able to get this working without the need for a script.