cancel
Showing results for 
Search instead for 
Did you mean: 

Execute Flexible Query in Admin Context ?

Former Member
0 Kudos

Hi,

i've a requirement to search the all orders from all the users from single base site. While executing i could not able get the all orders.

how to write flexible query to get all orders in admin context ?

Please Let me know!!!

Thanks Kishore MS

Accepted Solutions (1)

Accepted Solutions (1)

hiddebroerse
Participant
0 Kudos
 getSessionService().executeInLocalView(new SessionExecutionBody() {
 // your code
 }, getUserService().getAdminUser());

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Kishore,
I would say the correct thing would be to disable the search restrictions, do the search and enable them back again. In code it would be something like this:

     searchRestrictionService.disableSearchRestrictions();
     // Your query
     searchRestrictionService.enableSearchRestrictions();

Regards, Juan

hiddebroerse
Participant
0 Kudos

This is not a safe solution. Other concurrent queries will be affected by this.