I want to do something pretty basic: Enter a Sales Order Number (Lookup field) and then select the Serial Number of an Item from a Picklist.

The following code is working but it's not reRendering the S/N field once a sales order number is changed. The only way the picklist is getting updated is by saving the record with the Sales Order Number.

I read about people having difficulties with Event="OnChange" with lookup fields not triggering the action support.

Should I design this differently?

VF page:

    <apex:page standardController="Customer_Feedback__c" extensions="CustomerFeedbackControllerExtension" lightningStylesheets="true" name="SalesOrderSection" >
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection title="SO Visualforce test" columns="2">
            <apex:OutputField value="{! Customer_Feedback__c.GAT_Sales_Order__c}" id="SalesOrder">
                <apex:actionSupport event="OnBlur" reRender="selectListValues" action="{!SoPopulated}" focus="selectListValues" />

            <apex:selectList value="{! Customer_Feedback__c.S_N__c}" title="S/N" multiselect="false" size="1" id="selectListValues">
                <apex:selectOptions value="{!SNOptions}"/>

            <apex:inlineEditSupport event="OnClick"/>
           <apex:pageBlockButtons location="top">
            <apex:commandButton value="Save" action="{!save}" id="saveButton"/>
            <apex:commandButton value="Cancel" action="{!cancel}" id="cancelButton"/>

Controller Extension:

public class CustomerFeedbackControllerExtension {

    public List<SO_Item__c> SOItems {get; set;}
    public Customer_Feedback__c cf {get; set;}
    public Id SOId;

    public CustomerFeedbackControllerExtension (ApexPages.StandardController stdcontroller) {
        cf = (Customer_Feedback__c)stdcontroller.getRecord();


    public void SoPopulated()   
        SOId = cf.GAT_Sales_Order__c;
        system.debug('About to triger S/N Options');


    public List<selectOption> getSNOptions()
    {   SoId = cf.GAT_Sales_Order__c;
        system.debug('About to query SO Items. This is SOId:'+SOId);
        SOItems = [SELECT id, Part_Number__c, S_N__c FROM SO_Item__c WHERE SOId__c=:SOId];      
        List<SelectOption> Options = new List<SelectOption>();
        Options.add(new SelectOption('','-None-'));
        for(SO_Item__c Items : SOItems)
            Options.add(new SelectOption(Items.S_N__c,Items.S_N__c));
        system.debug('Return Options is next');
        return Options;

  • if you temporarily remove the inlineeditSupport (and change the outputField to an inputField) does it work as you desire?
    – cropredy
    Commented Apr 25, 2019 at 0:41
  • @cropredy I tried that and it doesn't work. Commented Apr 25, 2019 at 17:50


You must log in to answer this question.

Browse other questions tagged .