You need to sign in to do that
Don't have an account?

Can I pass a value to an inputField?
I want to create a simple one page wizard that is hit from a link off an Opp. The goal is to create a new Opp, after letting the user select a different Account and set values for some Opp fields. I thought I would use the standard Opp controller and then just pass some values to pre-populate the inputFields, but I can't figure out how to do that:
Ideally, I'd just grab some values off the querystring and set the inputFields to them. I can't find any examples or threads where this is addressed. Am I off the mark?
Thanks!
Steve
Code:
<apex:page standardController="opportunity"> <!-- Begin Default Content REMOVE THIS --> <h1>Choose an Organization</h1> <apex:form> <apex:inputField id="newOppAccountId" value="{!opportunity.accountid}"/> <p/> <apex:inputField id="newOppCloseDate" value="{!opportunity.closedate}"/> <p/> <apex:inputField id="newOppAmount" value="{!opportunity.amount}"/> <p/> <apex:inputField id="newOppName" value="{!opportunity.name}"/> <p/> <apex:commandButton action="{!save}" value="Create Matching Gift"/> </apex:form> <!-- End Default Content REMOVE THIS --> </apex:page>
Ideally, I'd just grab some values off the querystring and set the inputFields to them. I can't find any examples or threads where this is addressed. Am I off the mark?
Thanks!
Steve
Seems like part of your answer got deleted. Should there be something between the first and second lines?
Thanks,
Steve
I created a constructor to try to preset the inputFields, but no dice:
I feel like I'm missing something basic.
Thanks,
Steve
Message Edited by dchasman on 05-14-2008 08:37 PM
Steve