Identify used UI

Victor Ogrizko
Tera Guru

Hello!

I need to find the way how to show UI action on form only if operator using "UI16" and hide it if "Polaris UI" is used.

Any suggestions?

 

Br,
Victor

1 ACCEPTED SOLUTION

Abhay Kumar1
Giga Sage

Hi Victor, 

I believe if you have not enabled 'Polaris UI' for all users then there in User Preferences you would have used a property 'glide.ui.polaris.use' , you can look this property and how this is configured ( means there are some certain conditions to enable for all or enable for some sort of users this New UI)  in your organization/PDI, and on top of that you can use condition to show UI.

Hope this will help you!

View solution in original post

3 REPLIES 3

Abhay Kumar1
Giga Sage

Hi Victor, 

I believe if you have not enabled 'Polaris UI' for all users then there in User Preferences you would have used a property 'glide.ui.polaris.use' , you can look this property and how this is configured ( means there are some certain conditions to enable for all or enable for some sort of users this New UI)  in your organization/PDI, and on top of that you can use condition to show UI.

Hope this will help you!

Hello!

 

Thanks, its working. Just was curious if there is some native method.

 

Here is my script (method in custom script include):

userEnabledPolaris: function(usr) {  //usr - user's sys_id, gs.getUserID();
var gr = new GlideRecord('sys_user_preference');
gr.addQuery('name', 'glide.ui.polaris.use');
gr.addQuery('user',usr);
gr.query();
if ((gr.next())&&(gr.value=='true'))
return true;

var gr2 = new GlideRecord('sys_user_preference');
gr2.addEncodedQuery('name=glide.ui.polaris.use^userISEMPTY'); // system default
gr2.query();
if ((gr2.next())&&(gr2.value=='true'))
return true; //no personal setting, use global "true"

return false;
},

@Victor Ogrizko  Very frankly i could not find there is any native approach if  you are enabling New UI in mixed mode.

For you reference, we had found an issue and created a HI case for this that if you make system field false and try to save/update record in both UI & script, sometimes it makes true automatically.

So we have a workaround to make workflow(false) while updating through script for this.

Hope this will help you.