Smart Client Scripting - SCS.Views.SelectView does not work

Hello,

I have the following script, everything but the “SelectView” works:

<ScriptEngine>
<Login>
<ServerAddress>localhost</ServerAddress>
<AuthenticationType>Windows Default</AuthenticationType>
</Login>
<Script>
SCS.Application.HideSidePane();
SCS.Application.Maximize();
SCS.Application.ShowLive();
SCS.Views.SelectView('Private.Vues.Interface');
</Script>
</ScriptEngine>

If I display an HTML page that has this button, it works perfectly:

<input type="button" value="Interface" onclick="SCS.Views.SelectView('Private.Vues.Interface');">

We use Essential+, is this the problem? In “about:script” I found the alternative call “SCS.Views.All.Private.Vues.Interface();” but that does not work either (it works from the about:script page but that’s it.

I have already enabled https://supportcommunity.milestonesys.com/s/article/Smart-Client-scripting-in-HTML-view-elements?language=en_US

Also, do you know how to toggle fullscreen instead of maximize? I’m talking the real fullscreen (F11).

EDIT: found fullscreen with “SCS.Application.ShowFullScreenView();”, but same story it only works once the smart client is loaded inside an HTML page, it does not work as a startup script.

Kind regards,

Philippe

Oh actually I am mistaken, none of the “SCS.” calls work at startup. Then do work once the smart client is loaded tho.

Ok I managed to reproduce my problem:

<ScriptEngine>
 <Login>
   <ServerAddress>localhost</ServerAddress>
   <AuthenticationType>WindowsDefault</AuthenticationType>
 </Login>
 <Script>
   SCS.Application.Maximize();
   SCS.Application.ShowFullScreenView();
   SCS.Application.ShowLive();
   //SCS.Views.SelectView('Private.Vues.Interface');
 </Script>
</ScriptEngine>

As soon as you uncomment the “SelectView”, nothing works anymore.

Following sentence works for me, please use “ ” instead of ’ '.

<Script>
   SCS.Application.Maximize();
   SCS.Application.ShowFullScreenView();
   SCS.Application.ShowLive();
   SCS.Views.SelectView("Private.MyGroup.MyView");
</Script>

Thanks, that works.

Any idea how to access some debug logs for these scripts? Maybe in the smart client logs?

The Smart Client “client logger” logs might contain information, there is no logging specifically on scripting and you might not find log messages but you could give it a try.

You will need to set up Smart Client log if you want to get the log - https://developer.milestonesys.com/s/article/Enable-XProtect-Smart-Client-logging-automatically-and-manually