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

Assign a default value to a field
Hi all,
I'm having some trouble passing default values into <apex:inputFields> is it possible? For instance if I want to set
<apex:inputHidden value="{c.Sales_Prospect__c}" /> to a certain value can I do it?
Basically I'm looking for a similar action to HTML where I can have something like the following
<input type="hidden" name="sales_prospect__c" value="David G">
I've looked through the attributes of <apex:inputHidden> and <apex:inputField> and noticed there are none for default value.
any help would be much appreciated.
basically my problem is that in my code {c.Sales_Prospect__c} is a lookup field. when I submit the form I have created I know what value I want to put in that field but I just can't seem to do it, it's always blank and creates an unrelated record.
P.S I am new to visual force here
Thanks,
Patrick
Message Edited by patske on 05-30-2008 12:05 AM
Message Edited by patske on 05-30-2008 12:07 AM
I'm having some trouble passing default values into <apex:inputFields> is it possible? For instance if I want to set
<apex:inputHidden value="{c.Sales_Prospect__c}" /> to a certain value can I do it?
Basically I'm looking for a similar action to HTML where I can have something like the following
<input type="hidden" name="sales_prospect__c" value="David G">
I've looked through the attributes of <apex:inputHidden> and <apex:inputField> and noticed there are none for default value.
any help would be much appreciated.
basically my problem is that in my code {c.Sales_Prospect__c} is a lookup field. when I submit the form I have created I know what value I want to put in that field but I just can't seem to do it, it's always blank and creates an unrelated record.
P.S I am new to visual force here
Thanks,
Patrick
Message Edited by patske on 05-30-2008 12:05 AM
Message Edited by patske on 05-30-2008 12:07 AM
I've been trying to figure out a way to do it for 3 days now.
for e.g
So when I'm creating a new record I add it to the values of the field. The same can be done when adding objects to a list.
Hope this helps
Thanks