Hide Choices on contact_type field on HR Case based on Assignment group values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2024 08:31 AM
Hi Everyone,
I have a requirement where Assignment group is ABC or XYZ I need to hide 3 choices under Source (contact_type) field which is a reference field.
Hide only 2 choices and set a default value when assignment group is AAA or CCC - Need to do this for a couple of groups.
I have tried using removeOption on OnLoad script but realised it doesn't work on Reference fields.
How do I achieve this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 05:53 AM - edited 05-21-2024 05:54 AM
@ImpuV i just checked in my pdi onload script is working just check if the table name selected is correct and set ui type to all ,
and i dont think there is any other way to set this without scripting so u have to include all the condition in the same onload client script
Change according to your requirement,
table: sn_hr_core_case_talent_management
onload script:
function onLoad() {
var groupName = g_form.getValue('assignment_group');
alert('onload' + groupName);
if (groupName == '22d52c269f221200d9011977677fcf97' || groupName == 'a0f7ac269f221200d9011977677fcfcc') //checking group is hr tier1 or tier 2 in my case
{
alert('inside if');
g_form.removeOption('contact_type', 'email'); // to remove the option
g_form.setValue('contact_type', 'phone'); // to set the default value
}
}
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2024 08:40 AM
Hi Swati,
I was able to achieve this with adding and removing options. Are you able to change choices later on?
I tried to create onChange script for the same I am able to achieve it but I am not able to change the value of the choice. In my case I havent set any value as default. Still it's taking a default value.
Thank you