- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2024 06:47 AM
Hi all
I have a catalog item (IT Feedback) which has a compliments and complaints drop down. When 'none' or 'compliment' is selected, the dropdown with choices for complaints should be hidden. I cannot get it to work. I attach all necessary screenshots and code.
Please assist me.
Regards
Thereza
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2024 07:04 AM - edited 10-22-2024 07:05 AM
Hi @Thereza Van der ,
In your UI policy, You have already mention condition now then you can create a UI policy action in the related list where you have to select the field "Nature of Complaint" and set "Visible" field as false and mandatory set to false.
Hope this help you.
Regards
Moin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2024 07:00 AM
Hi,
The last bit of code looks like a business rule.
That wont work.
It should be a simple Catalog ui policy that will have the condition -> When 'none' or 'compliment' is selected
and in the ui policy action you can add the field to show
Something like below
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2024 07:00 AM - edited 10-22-2024 07:01 AM
I can see that nature_of_complaint field is mandatory on the form
So before making it set display false you should make it mandatory false otherwise it wont be hidden
Please write on change client script on field please_select
// Get the value of the 'please_select' field
var category = g_form.getValue('please_select');
// Check if the value is 'compliment' or 'none'
if (category == 'compliment' || category == 'none') {
// Hide the 'nature_of_complaint' field
g_form.setMandatory('nature_of_complaint', false);
g_form.setDisplay('nature_of_complaint', false);
} else {
// Show the 'nature_of_complaint' field
g_form.setDisplay('nature_of_complaint', true);
g_form.setMandatory('nature_of_complaint',true);
}
If my response helps you resolve your issue. Kindly mark it as helpful & correct. It will be helpful to future readers
Thanks,
Sejal
Thanks & Regards
Sejal Chavan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2024 07:04 AM - edited 10-22-2024 07:05 AM
Hi @Thereza Van der ,
In your UI policy, You have already mention condition now then you can create a UI policy action in the related list where you have to select the field "Nature of Complaint" and set "Visible" field as false and mandatory set to false.
Hope this help you.
Regards
Moin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 02:42 AM
Thanks for assisting everyone 🙂