User can set form set id in browser and get view what he want, without routing

Good day,
i have a list form with 2 views in form. I make in routing to redirect to second view. it works. But in main page i have a link to default view - and users were able to open first view. How to make routing working correctly? I tried to put form set ID in browser link and it redirects to view with such id. what it will be if some users will save this form set id, and will be able to open another views, how to prevent that ?
Code routing:

if (window == {
  //replace with your form set ID
  return 'bed23393-f5d3-4675-b5d6-0b382e317688';


If user set after /Element/bed23393-f5d3-4675-b5d6-0b382e317688 - form set id he can open another views, without routing rules..

Hello @ixxxl,

You can add additional routing conditions. For instance, check item status or check current user.

Hi @mnikitina ,
this is another form with status check:

if (item) {
    return item.get()
        .then(function (item) {
            return web.currentUser.get()
                .then(function (user) {
                    return web.siteUsers.getById(user.Id).groups.get()
                        .then(function (groupsData) {
                            //var groups = [];
                            //Check if the user is a member of the desired groups and add them to the array
                            var vb = false;
                            for (var i = 0; i < groupsData.length; i++) {
                                if (groupsData[i].Title == 'HRConcediuAdmin') {
								 if (item.Nume_x0020_prenumeId != user.Id || item.AuthorId != user.Id ){
                                    //	alert("popal");
                                    vb = true;
								 if (item.Boss_x0020_Level_x0020_1Id.indexOf(user.Id) >= 0 || item.Boss_x0020_Level_x0020_2Id.indexOf(user.Id) >= 0){
                            if (vb) {
                                return '7e20c0b9-102a-41d6-bb41-5dea73c97cbb'
                            } else if (item.Starea_x0020_cererii == 'Aprobare nivel 3') {
                                return '479e8dba-0013-4153-b10b-94150a1c0be3'
                            } else if (item.Starea_x0020_cererii == 'Aprobare nivel 2') {
                                return 'feafb281-1f8e-43e0-9995-d2a9f54ce8d5'
                            } else if (item.Starea_x0020_cererii == 'Aprobare nivel 1') {
                                return 'f3705962-2465-4208-bf90-8848e541e623'
                            } else if (item.Starea_x0020_cererii == 'Aprobare DRUO') {
                                return '29aa934d-659a-43de-b6d0-e1148eb1ea8c'
                            } else if (item.Starea_x0020_cererii == 'Aprobare HR') {
                                return '29aa934d-659a-43de-b6d0-e1148eb1ea8c'
                            } else if (item.Starea_x0020_cererii == 'Aprobată') {

                                return '9e9437d8-a242-4205-9f50-eeb93695de44';

                            } else if (item.Starea_x0020_cererii == 'Respinsă') {
                                return 'fe28b88c-39d7-40c2-bed3-92aa3a075b47'
                            } else if (item.Starea_x0020_cererii == 'Respinsă de înlocuitor') {
                                return 'fe28b88c-39d7-40c2-bed3-92aa3a075b47'
                            } else if (item.Starea_x0020_cererii == 'Aprobare Inlocuitor(i)') {
                                return '89681232-a7eb-406c-ae57-e1a1da678674'
                            } else if (item.Starea_x0020_cererii == 'Aprobare remunerare') {
                                return 'aa63219f-4144-4518-8ce2-3523c9c2c28e'
                            } else if (item.Starea_x0020_cererii == 'Aprobare condițională') {
                                if (item.ContabilId && item.ContabilId.indexOf(user.Id) >= 0 && item.Nume_x0020_prenumeId != user.Id) {
                                    return '9e9437d8-a242-4205-9f50-eeb93695de44'
                                } else {
                                    return '3a9bbb16-9592-4e63-8dda-338a2d905145'
                            } else if (item.Starea_x0020_cererii == 'Respingere condițională') {
                                return '3a9bbb16-9592-4e63-8dda-338a2d905145'
                            } else if (item.Starea_x0020_cererii == 'Închidere cerere') {
                                return '9e9437d8-a242-4205-9f50-eeb93695de44'
                            } else if (item.Starea_x0020_cererii == 'Îndeplinire condiții') {
                                return 'f30e7b4c-4959-4036-953f-c1c3ce4ebf15'
                            } else if (item.Starea_x0020_cererii == 'Anulată') {
                                return '36bc5cf6-941f-4559-b669-3991b69d97d9'
                            } else if (item.Starea_x0020_cererii == 'Executat DCF') {
                                return '36bc5cf6-941f-4559-b669-3991b69d97d9'





But if i put manually in browser another form set id ,i can open it . i have some very "clever" users which stored form set id , and open themselves when they want ... indifferent of the status


Okey, I see.

What version of the desktop designer are you using?

In v1.8.7, separate forms are not generated anymore for every form set. A default form resolves the form set now. So you can export existing form sets, delete form set in the desktop designer:

And delete corresponding form set folders in http://intranet/procese/SitePages/PlumsailForms/Extras%20privind%20remunerarea/Element

Then create new form sets. For a new form sets a seperate form is not created and can't be accessed by changing the form link.