By default USD tabs have an “x” which allows the user to close the tab. But sometimes you want to prevent this from being possible. I have commonly used this in two situations;
- You may have a global tab that opens when USD loads, if this tab is important you may want to force it to always be present.
- Within a session on accounts (for example) you might want to prevent the user from closing the tab for the account that the session is based on.
Step One – Create (if needed) a user can close uii action
Navigate to the uii actions on the hosted control which you wish to prevent from closing. Look for an action called “SetUserCanClose”
Step Two – Add an action
Within the actions area of the Unified Service Desk settings now create an action that will be used to prevent the close.
Name = “CRM – User Can Close”
Hosted Control = “CRM”, this is the name of the hosted control / tab you would like to prevent from closing.
Action = “SetUserCanClose”, this will be the action you created in step one.
Data = “UserCanClose=false”
Step Three – Trigger the action you created
In this example, because we are using a global tab, the action must be added to the global container hosted control. Achieved by adding the action into the DesktopReady event of the global container.
Note: If the hosted control is a session based control the action will need to be added to the windows navigation rule used to open the session.