How to show values in Service CI field ( dropdown)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2025 10:21 PM - last edited a month ago
Hi All,
kindly share your thoughts and suggestions on below issue
we have close to 30+ option values in Service CI .
Please let me know how can we do this,
1. Do we have to create OnLOAD client script with using removeOption & addOption in script ? Without using addOption and removeOption can we achieve in another way. ?
2. Without using script can't we achieve this ?
3. If I create a OnLoad client script , script crossing 100+ lines , don't we have other alternative way ?
While creating new request user able to select Service CI as per below , on existing record for everyone it should be readonly.
On new record : if Logged-In User belongs to below
For Admin's roles users :
Service CI field should be readonly and selected with "General"
For Apple support Group :
Show only Apple related values in Service CI
For Samsung Support Group
Show only Samsung related values in Service CI
For Realme Support Group
Show only Realme related values in Service CI
For OCI P2 Support group
Show only Realme & Samsung related values in Service CI
For OCI P1 Support group
Show only Google Pixel & Apple related values in Service CI
For Partner Groups
Show only Google Pixel & Apple & Samsung related values in Service CI
can't we achieve this with ZERO code ?
Can't we achieve this without using Client scripts ? without using addOption, removeOption ? ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2025 12:00 AM
Hi @Supriya25
the catalog client script is the best approach, however you mention onLoad, in that case the variable must be already displayed, otherwise it will be onChange
Very drafty version could look like this:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(newValue == 'apple_support'){
g_form.addOption('name',optionName, optionValue);
g_form.removeOption('name',optionName, optionValue);
}
if(newValue == 'samsung_support'){
g_form.addOption('name',optionName, optionValue);
g_form.removeOption('name',optionName, optionValue);
}
if(newValue == 'realme_support'){
g_form.addOption('name',optionName, optionValue);
g_form.removeOption('name',optionName, optionValue);
}
if(newValue == 'another'){
g_form.addOption('name',optionName, optionValue);
g_form.removeOption('name',optionName, optionValue);
}
}
Let me know hoy do you progress
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2025 12:10 AM
@Supriya25 then I realised you mentioned some roles.
Admin role is clear, but how do you differentiate between Apple support group and Partner support group?
in the onLoad script it could be HasRole() or hasRoleExactly() to check for the role and eventually do the trick, but if the support groups have same role, how do you distinguish them?
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2025 08:59 AM - edited 07-27-2025 09:06 AM
Hi Kamil,
1. to differentiate , we will use Display Business rule
g_scratchpad.AppleTeam = gs.getUser().isMemberOf("Apple support group");
we will call in Client script if(g_scratchpad.AppleTeam);
2. We can't use Record producer, because this table is child table to some other table. based on Parent table state value, assigned-to user manually will create one child record in "Service CI" table.
my concern is, we have 30+values , so for 30+ values if we design code using with addOption and Remove Option code lines will cross 150+ lines .
can't we achieve this with ZERO code ?
Can't we achieve this without using Client scripts ? without using addOption, removeOption ? ??
any alternative options ?
if(g_scratchpad.AppleTeam){
g_form.addOption('name',optionName, optionValue);
g_form.removeOption('name',optionName, optionValue);
}
if(g_scratchpad.SamsungTeam){
g_form.addOption('name',optionName, optionValue);
g_form.removeOption('name',optionName, optionValue);
}
if(g_scratchpad.GoogleTeam){
g_form.addOption('name',optionName, optionValue);
g_form.removeOption('name',optionName, optionValue);
}
if(g_scratchpad.RealmeTeam){
g_form.addOption('name',optionName, optionValue);
g_form.removeOption('name',optionName, optionValue);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2025 10:19 AM
Hey Supriya!
i think you can use Use a Reference Qualifier on the Service CI field to control what values appear, based on group or role.
You can use something like:
Client-side control (like making field readonly):
Use g_form.setReadOnly('service_ci', true);
Do this inside an onLoad script only for new records (g_form.isNewRecord())
If this helps kindly accept the solution thanks much.
Kind Regards,
Mohamed Azarudeen Z
Developer @ KPMG
Microsoft MVP (AI Services), India