Hi,
Then you have to set partner_fct along with the bp partner id.
Add below code in search event along with code i have provided in my earlier thread,
lr_query_service->ADD_SELECTION_PARAM( iv_attr_name = 'PARTNER_FCT'
iv_sign = 'I'
iv_option = 'EQ'
Iv_low = 'Give contact partner function value here' ).
so that you will get all the leads has login user id as contact person partner function in system.
Best Regards,
Dharmakasi.