How can I prevent Demand records from opening in unintended workspaces or make them read-only

wicky05926088
Tera Contributor

Demand records are currently accessible and editable from multiple workspaces. Our objective is to restrict editing to a single designated workspace for example( strategic planning Workspace).

Is there a recommended OOB approach to:

Force Demand records to always open in the designated workspace, regardless of the entry point, or
Allow records to open in other workspaces but automatically render them read-only and prevent updates?
We are looking for the most sustainable and upgrade-safe solution.

4 REPLIES 4

Ankur Bawiskar
Tera Patron

@wicky05926088 

no direct way to handle this but 1 workaround

-> if user opens that record in unwanted workspace, run onLoad client script on that table and inform user and try to close the browser tab or redirect user to native home UI

💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Thank you Ankur, i wrote a client script which is not working can you please share the code snippet i will work on that tooo 

jameswoodfo
ServiceNow Employee

I shared this with my team just this week and it could be the answer to when a client say that I want to force user to using workspaces. Here you go:

 

A tip to pass along: if you want to force users into using workspace, you can use navigation handlers (sys_navigator) to do so. For example, you create a list data visualization for the project able and you want to make certain that when the user clicks on the reference link they are taken to a workspace instead the platform UI, you could do something similar to this on the pm_project table:

answer = g_uri.toString();
if (!gs.hasRole('admin') && gs.hasRole('project_user')) {
    answer = '/now/workspace/project/home/sub/planning/pm_project/' + g_uri.get('sys_id') + '/' + new GlideDateTime().getNumericValue();
}
Principal Technology Consultant, Expert Services, CTA/CIS+

Thanks  , i have given this solution still some thing were expecting through search