You need to sign in to do that
Don't have an account?
Brian Cherry FWI
SelectOptions not showing
I have a lookup field and a extenstion to convert the lookup as a select list. Debug log is showing options, but the VF page is not... Any ideas of why the select options aren't populating?
16:48:39:015 USER_DEBUG [20]|DEBUG|(System.SelectOption[value="aBv1b00000000EiCAI", label="2/3/2017", disabled="false"])
public class BIWorkOrder { public Work_Order__c wo {get; set;} public list<Deployment_Cycle__c> Deployments {get;set;} public List<SelectOption> options {get; set;} public BiWorkOrder(ApexPages.StandardController stdcontroller) { this.wo = (Work_Order__c)stdcontroller.getRecord(); getItems(); } public List<SelectOption> getItems() { Deployments = [SELECT ID, Deployment_Date__c from Deployment_cycle__c where Deployment_Date__c > :system.Today() and Active__c = true order By Deployment_date__c ASC]; list<selectOption> options = new List<selectOption>(); for(Deployment_Cycle__c d :deployments) { string newDate = d.Deployment_date__c.month() + '/' + d.deployment_date__c.day() + '/' + d.deployment_date__c.year(); options.add(new selectOption (d.id, newDate)); } system.debug(options); return options; } }
<apex:pageBlockSection title="BI Fields" columns="2"> <apex:inputField value="{!Work_Order__c.Resource__c}" required="false"/> <apex:selectList value="{!Work_Order__c.Deployment_Cycle__c}" > ---> Lookup field <apex:selectOptions value="{!Options}"></apex:selectOptions> ---> Options </apex:selectList> <apex:inputField value="{!Work_Order__c.Due_Date__c}" required="false"/> <apex:inputField value="{!Work_Order__c.Notes__c}" required="false"/> <apex:inputField value="{!Work_Order__c.Date_Complete__c}" required="false"/> </apex:pageBlockSection>Debug:
16:48:39:015 USER_DEBUG [20]|DEBUG|(System.SelectOption[value="aBv1b00000000EiCAI", label="2/3/2017", disabled="false"])
or
you saved the list in LOCAL-options and not in the global-options
All Answers
or
you saved the list in LOCAL-options and not in the global-options