cancel
Showing results for 
Search instead for 
Did you mean: 

How can we disable a particular search restriction?

amitkumarbansal
Explorer
0 Kudos
279

lets say I have 6 search restriction about to apply on flexi query.
I want to disable one of them during flexi. How can I go through.

I dont see any specific method in SearchRestrictionService. But one approach I am considering is to find all and filter the one I need and disable it.

View Entire Topic
geffchang
Active Contributor

You are on the right track.

Search for the SearchRestrictionS to disable using DefaultSearchRestrictionService.getActiveSearchRestrictions, DefaultSearchRestrictionService.getSearchRestrictionsForType, or the other methods. Then, disable the search restrictions inside sessionService.executeInLocalView.

amitkumarbansal
Explorer
0 Kudos
DefaultSearchRestrictionService.getSearchRestrictionsForType This worked for me.
amitkumarbansal
Explorer
0 Kudos
1. Find all restrictions by Type
amitkumarbansal
Explorer
0 Kudos


1. Or if there is case of specific search restriction, find that search restriction by Flexible query.
2. Before code execution, change the active flag and save it.
3. Post code execution enable the flag of search restriction