Apply custom filter on the entries in admin control panel using custom plugin in craft cms 3.5 I was referring to Filter entries in the CP based on custom permission and Filter entries in the CP based on custom permission
It seems onBuildElementsQuery was available only in 2.x.
Is there any alternative for craft 3.x?
Found it!!! Used ElementQuery::EVENT_AFTER_PREPARE