Not equal to is not working in client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2023 07:51 PM
Hi,
I am trying to remove choice options from variable based on grade level is not management 18 and above. I tried using the below script and it is not working. Please help! Thanks,
function updateCampus(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
alert(answer);
//if ((answer == 'Management 18') || (answer == 'Management 19') || (answer == 'Management 20') || (answer == 'Management 21') || (answer == 'Management 22')) {
if (answer != 'Management 18' || answer != 'Management 19' || answer != 'Management 20' || answer != 'Management 21' || answer != 'Management 22') {
g_form.removeOption('role_data_access', 'Leadership');
g_form.removeOption('role_data_access', 'Executive');
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2023 06:26 AM - edited ‎03-07-2023 06:27 AM
Hi,
Is there a reason you're adding the sys_id onto the encoded query line? That doesn't work.
The addQuery with the sys_id for the user can be it's own line (like you had), then the addEncodedQuery is what I mentioned above where you filter on list view as you need, then right-click the last piece of the filter breadcrumb and copy the query. I would have definitely mentioned it if you needed to add on the sys_id there 🙂
Please try again, you're very close!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!