function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
marcobmarcob 

search filter on master object

Hi,

in a search dialogue (pop up window), i only want to search on records that have a specific master-id.

I.e. i have employers, and each employer has multiple employees. When i have selected an employer on my VF page, and the user wants to search for an employee, he must search within that employer, so he cannot find employees that have a different employer as parent.

Thus,employee has a master-detail relationship with employer.

 

Is this achievable without doing anything in my VF page/controller?

 

Anyone?

Marco

 

Deshraj KumawatDeshraj Kumawat

Hi,

 

We can create lookup filters only specific to Users, userProfiles, record types and specific to fields of the master object, I do not thik that you can aceive this without customizing you VF page.

 

I had the same requirement for one of my project and we implemented custom loop up functionality, I careted a new Custom VF page and opening that custom VF page on click of the lookup icon(look up search icon), this page is custom VF page and I am showing the records only specific to my requirement.

 

Thank You!!

marcobmarcob

Hi,

thx for your respons. Did you create this custom VF page as pop up window, and if so, did you manage to close that pop up window and return to the original page with the selected row(id)?

 

Marco

Deshraj KumawatDeshraj Kumawat

Yes, I managed to close the pop up window on selection of a record from the pop up window and update the field on the parent page with the selected value.

 

I used standard salesforce javascript(same javascript function used by salesforce to close popup and update parent page) to clsoe pop window and update the parent page.

 

Note: I can share the block of code once I go home today after office.

 

Thank You !!

 

Deshraj Kumawat

Certified Developer | Certified Administrator

marcobmarcob

Hi,

if you can send me the code, you will make me unbelievably happy!!!!!!!!!!!!!!!!!!!!!

Thx!

Marco

Deshraj KumawatDeshraj Kumawat

Sure, I will share the Code by tonight (EST).

 

Thanks

Deshraj Kumawat

Certified Developer | Certified Administrator

marcobmarcob

Great, many thanks in advance!

marcobmarcob

Hi, did you manage to find the code, hope it is not lost..