How to restrict values in choice list based on roles?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2022 06:19 PM
Hi Community,
I've a choice list with 4 values inside. This choice list is in UI Page and also in form. How can I restrict some of the values inside choice list to certain roles ? How to code to restrict it in both UI Page and in form ?
Below is the choice list in UI Page for pop out form.
This is the form where the data are saved from the ui page.
How can I achieve this ? Thanks
- Labels:
-
Service Portfolio Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2022 06:45 PM
On the Baseline form, you will have to use a client script to show/hide choice options based on user roles.
The standard way of doing this is to have an onload client script which will first clear all the options, and then add each option back based on the role conditions.
Use the below lines of code:
g_form.clearOptions('fieldName');
g_form.addOption('fieldName', 'choice_backend_name', 'choice_frontend_name', position);
On the UI Page, the options should be coming from the HTML field jelly code. There should be a g_evaluate tag which glides the choice table. Add your conditions there