Dynamic home page: different start page depending on user's role

Instead of splitting a form page into 'Form-Fillers' and 'Administrators' sections, is there a more elegant way of auto-[re]directing users depending on role membership?

Best regards

Hi Stephen,

You can leverage the App Pages redirection approach.

For example, you have total of 4 App Pages:

1 Home App Page, and 3 App Pages such as Admin Dashboard, Manager Dashboard, and Employee Dashboard.

In Home App Page, create side navigation that consists of 3 entries (Admin Dashboard, Manager Dashboard, and Employee Dashboard).

In Each entry in side nav, assign a rule to show only based on current user role. And, in onClick event, you can use app.openAppPage method to redirect in each App Pages.

https://help.hcl-software.com/domino-leap/1.1.5/ref_application_object.html

In addition, in each Dashboard App Pages, you can design another side nav that consists of Form redirection. For example, in Employee Dashboard, there is side nav entry something like "File a claims", then in onClick event, you can use app.openForm method to redirect in the target Form.

Hope this helps.

Thanks,

Jayve

If Stephen wishes to use app.openAppPage() as an automatic appPage selector, where is the best place to incoke the call? At the end of form.onLoad()?

Hi Jan,

It seems you are validating the AppPage redirection. Yes, it is possible to place in onload or onshow event.

Kind regards,

Jayve

Hi Stephen,

For creating Side Nav design technique, please check this wiki:

https://hclwiki.atlassian.net/wiki/spaces/HDV/pages/552567022/Side+Navigation+with+Dynamic+Content

Thanks,

Jayve

Probably you should create separate form page for end users and administrators.
Initially they would land on a common form page. During on load event check the user role, and depending upon user role redirect the user to respective form page.

app.getCurrentUserRoles - Returns a comma-separated list of all the roles for which the current user is a member.

app.isCurrentUserInRole(roleName) - Returns true if the current user is a member of the provided role, otherwise false.

app.openAppPage(appPageId, appUid, newTab) - Opens the app page of an application that matches the provided appPageid.

app.openForm(formId, appUid, newTab) - Opens the form of an application that matches the provided formId.

https://help.hcl-software.com/domino-leap/1.1/ref_application_object.html

Cool. I was not aware that app.openAppPage() nad app.openForm() can open pages from other app using page id.