How to restrict filter options(fields) in service Portal ?

madhuri15
Tera Contributor

Hi ,

I don't want to display all the fields by using filter, How can restrict all the fields coming from incident table?

Any help will be appreciated.

find_real_file.png

 

 

find_real_file.png

I dont want to see all the fields which are not useful for the end-users , how I can remove these options

 

1 ACCEPTED SOLUTION

divyamduggal
Tera Expert

Hi All,

I worked on this and was able to hide them using Read ACL. This will work same on both native and portal filter. Just create a row level ACL and remove access for end users and then create Field level ACLs to provide access to all the particular fields you want to show in filter.

Thanks,

Divyam

View solution in original post

13 REPLIES 13

Ruhi Jibhyenka1
Mega Guru

Hi Madhuri,

Check this out

Using catalog client script

Type: onChange
UI type: Desktop

function onChange(control, oldValue, newValue, isLoading) {
    //Limit the number of selected options in a list collector
    //Specify the max options and variable name below
    var maxOptions = 5;
    var varName = 'users';
    var leftBucket = gel(varName + '_select_0');
    var rightBucket = gel(varName + '_select_1');
    var selectedOptions = rightBucket.options;
    if(selectedOptions.length > maxOptions){
        //Move any options with IDs greater than maxOptions back to left bucket
        var selectedIDs = [];
        var index = 0;
        for(var i = maxOptions; i < selectedOptions.length; i++){
            selectedIDs[index] = i;
            index++;
        }
        //Move options and sort the left bucket
        moveSelectedOptions(selectedIDs, rightBucket, leftBucket, '--None--');
        sortSelect(leftBucket);
        alert('You cannot select more than ' + maxOptions + ' options.');
    }
}

 

Using catalog client script(Service Portal Version)

Type: onChange
UI type: Mobile

function onChange(control, oldValue, newValue, isLoading) {
    //Limit the number of selected options in a list collector
    //Specify the max options and variable name below
    var maxOptions = 5;
    var collectorName = 'users';
    var myListCollector = g_list.get(collectorName);
    var selectedOptions = g_form.getValue(collectorName).split(',');
    if(selectedOptions.length > maxOptions){
        //Remove the last item
        myListCollector.removeItem(selectedOptions[selectedOptions.length-1]);
        g_form.addErrorMessage('You cannot select more than ' + maxOptions + ' options.');
    }
}

 

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy.

Thanks,

Ruhi.

 

Hi Ruhi,

Thanks for your response. But this is not a catalog item. This is an Incident. Is there any other way where I can restrict fieds which are  coming by default through the filter

Cynthia Flowers
Tera Contributor

Hi Madhuri,

Did you ever solve this problem? I am trying to do the same.

Hi Cynthia,

one way how you can achieve this is , you can write field level ACLs for each field which you want to hide from certain users.Then it works. 

-- What I have done is I removed filter and configured keyword search for end-users , then  they can search with keyword.

-- Sorry for the late reply. In case , if you need any help on this please reply me on this thread.

Thanks & Regards,

Madhuri