How to override SearchForm2.php method in upgrade safe manner ?

I want to customize the query functionalities, when filter the Contacts.

I have done this by modifying the “public function generateSearchWhere($add_custom_fields = false, $module = ‘’)” method on SearchForm2.php. (Path: include\SearchForm\SearchForm2.php).

But this is not Upgrade safe.

I tried to follow the steps on the below link but not success:

If any one can give me a solution to do this task, it would be grate…!!!

I found this link as a salesagility issue at GitHub.

Still I am waiting for get a help on this task.

Fixed in Fix #5722 Make SearchForm2.php customizable by pgorod · Pull Request #10089 · salesagility/SuiteCRM · GitHub