- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2024 09:48 AM
If subcategory is email or antivirus then service field must be hidden on incident form.How to achieve this using client script?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2024 10:29 AM - edited ‎02-18-2024 10:38 AM
@Shubham_verma write on change client script on subcategory field and use the below code snippet.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (newValue === '') {
return;
}
var subcategory = g_form.getValue('subcategory');
if (subcategory == 'email' || subcategory == 'antivirus') {
g_form.setDisplay('business_service', false);
} else {
g_form.setDisplay('business_service', true);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2024 10:24 AM - edited ‎02-18-2024 10:25 AM
Hi @Shubham_verma ,
Create on change client script and select field "subcategory" and add below script:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var subcat = g_form.getValue('sub_category');//update your field name
if (subcat == "email") {//update email value
g_form.setDisplay('u_rate',false); // update your service field name
}
}
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2024 10:30 AM