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
ChigurhChigurh 

Filter a input field on visualforce page

Can you filter a input field on a visualforce page base on a value that was passed to the page?

 

an account id was passed to the page via url and I want the  input field that does a look up to contacts to filter by that particular account

Navatar_DbSupNavatar_DbSup

Hi,

 

Yes you can filter that filed as steps below;

 

Suppose you have custom object let say, "custom object" that has a lookup field with contact, then you need to filter that lookup field based on account that is associated with account, so you can filter you contact lookup in custom object based on account, so further you will not need to filter your input field on apex page, when you will pass your accountid in url then your lookup input field only show contact related to that account.

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

ChigurhChigurh

Thanks, but sorry I should have clarified better. the Vf page allows the user to create a Master object record and multiple child records.  When the VF page is opened it is passed an account id to account field of Master object.  

 

Below, there is a lookup input field for  lookup field to a custom object for the related object record.  I want to filter this lookup on the Master object record account. Even thought the child has a formula that brings in the master object's account,  the relationship between the master and child records will not be created until the form is saved. 

 

Sorry for the confusion.  Hopefully this clarifies my issue. Thankyou for any help you can give