+ Start a Discussion

Limit Records for a VF page Lookup based on other lookup field

HI ,

I have a VF where i am trying to build functionality for Entering Orders and Mutiple Order Products . However while doing this User needs to select the price book and then all the products belonong to that Proce book should show up . Using a Input field is showing all the Pricebooks. 
So while entering Order details user selects an Account and based on this account selection all the Pricebooks available in the Lookup should be limited . 

Account ( Parent Object )
Price book Access ( Child to Account - Which contains Pricebooks this account can access )( Price book access object has a lookup relation to Price book)
<apex:page standardController="Order" tabStyle="Order" sidebar="true" standardStylesheets="true" >
   <apex:sectionHeader title="Order Entry Page" subtitle="{!Order.Ordernumber}"/>
      <apex:form > 

            <apex:pageMessages id="pgmsg"></apex:pageMessages>
            <apex:pageBlock id="kt">
                    <apex:pageBlockButtons >
                          <apex:commandButton value="Save" action="{!save}"/>
                          <apex:commandButton value="Cancel" action="{!cancel}"/>
                    <apex:pageBlockSection columns="2" collapsible="True" title="Order Information">
                             <apex:inputField value="{!order.AccountId}"/>
                             <apex:inputField value="{!order.CurrencyISOCode}"/>
                             <apex:inputField value="{!order.Order_ShipTo_Address__c}"/>
                             <apex:inputField value="{!order.status}"/>
                             <apex:inputField value="{!order.Order_Requested_Delivery_Date__c}"/>
                             <apex:inputField value="{!order.EffectiveDate}"/>      
                   <apex:pageBlockSection columns="1" title="Order Additional Information">
                             <apex:inputField value="{!order.Order_Comments__c}"/>                   
                   <apex:pageBlockSection columns="1" title="Price Book Information">
                             <apex:inputField value="{!order.Pricebook2ID}"/>                   
                   <apex:pageBlockSection columns="1" title="Order Product Information">
                   <apex:pageBlockSection columns="1" title="Order Discounts">
                           // Need to get fields from Account

User-added image