You need to sign in to do that
Don't have an account?
Abdul Khan 18
SelectOption and For loop problem....Class and Controller
I have exhausted all of 3 days trying to research how to do this but due to my limitations being new to the developing world I am afraid I really need some help. Any help is really appreciated.
Allso I don't know how to let the two communicate like what code I need to put into the VF Page to run that.
Once the process is it complete it should let me have a picklist in the Standard object Position where I can choose employment websites to choose to post job postings to. But I have to be able to save more than one website multi picklist type. Once I complete this it should work hopefully.
Thank you for any and all help!
Controller public with sharing class Editpositions { public Position__c myPosition; public Position__c editpos {get;set;} public Job_Posting__c editpost {get;set;} public Editpositions(ApexPages.StandardController controller) { this.editpos = (Position__c) controller.getRecord(); } public Position__c getPosition() { return myPosition; } Public List <SelectOption> getitems() { <SelectOption>() options = new List<SelectOption>(); // for (Employment_Website__c mySite = [SELECT Id, Name FROM Employment_Website__c]); // options.add(new SelectOption(mySite.Id,mySite.Employment_Website__c)) // Loop through the list and update the Name field // return options; } }The issue is where I have put the code in comments // because it was giving me all kinds of errors I just have no idea what I am doing at this point all I know is that after <SelectOption>() options = new List<SelectOption>(); I need to specify to for loop my employment website to selecOption or something like that.
VF Page <apex:page standardController="Position__c" extensions="Editpositions"> <apex:sectionHeader title="{!Position__c.Name}" subtitle="Edit Records"/> <apex:form > <apex:pageBlock title="Create and edit Job Positions"> <apex:pageBlockButtons location="both"> <apex:commandButton action="{!save}" value="Save Record"/> <apex:commandButton action="{!cancel}" value="Cancel"/> </apex:pageBlockButtons> <apex:pageMessages /> <apex:pageBlockSection title="Create New Position" columns="2"> <apex:inputField value="{!Position__c.Name}"/> <apex:inputField value="{!Position__c.Responsibilities__c}"/> <apex:inputField value="{!Position__c.Job_Description__c}"/> <apex:inputField value="{!Position__c.Skills_Required__c}"/> <apex:inputField value="{!Position__c.Educational_Requirements__c}"/> <apex:inputField value="{!Position__c.Java__c}"/> <apex:inputField value="{!Position__c.Apex__c}"/> <apex:inputField value="{!Position__c.C__c}"/> <apex:inputField value="{!Position__c.Javascript__c}"/> <apex:inputField value="{!Position__c.Travel_Required__c}"/> <apex:inputField value="{!Position__c.Location__c}"/> <apex:inputField value="{!Position__c.Open_Date__c}"/> <apex:inputField value="{!Position__c.Hire_By__c}"/> <apex:inputField value="{!Position__c.Min_Pay__c}"/> </apex:pageBlockSection> <apex:dataList value="{!Position__c}" var="Position__c"> <apex:outputText value="{!Position.Name}"/> </apex:dataList> </apex:pageBlock> </apex:form> </apex:page>
Allso I don't know how to let the two communicate like what code I need to put into the VF Page to run that.
Once the process is it complete it should let me have a picklist in the Standard object Position where I can choose employment websites to choose to post job postings to. But I have to be able to save more than one website multi picklist type. Once I complete this it should work hopefully.
Thank you for any and all help!
Below is your update code:
Class- VF page:
-Thanks,
TK
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
Invalid field Employment_Website__c for SObject Employment_Website__c for the Line I have underlined..what do you think it could be I can't figure it out unfortunately.
and
options.add(new SelectOption(mySite.Name, 'Name'));
create job posting for each id using the idvidual id from list and the id of position - does that make sense?
Final product since you last helped me.