function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Grady DuncanGrady Duncan 

How to bind variable for Contact standard controller

Hey, 

I am working on "Create a Visualforce page which shows a basic Contact record". I have everything displaying as long as I provide an ID in the URL. The problem is it does not accept it as a solution. 

What does it mean by bound (binding) to a variable?
ManojjenaManojjena
Hi Grady ,
Please explain your requirment bit more ,or else post your code for which we can help !!
Thanks 
Manoj
Diego GonzagaDiego Gonzaga
Hi Grady,

I don't have a clear explanation about Bound (bind) variable actually means, but I will try to explain what I get from it. The BIND variable is the variable name TIED with the controller, in this case the bind variable for the Contact controler would be Contact.

Using the standard controlar (<apex:page standardController="Contact">) and referencing it as {! Contact.FirstName } would be accepted as solution.
---------------------
<apex:page standardController="Contact">
    <apex:pageBlock title="Contact Summary">
        <apex:pageBlockSection >
            First Name: {! Contact.FirstName } <br/>
            Last Name: {! Contact.LastName } <br/>
            Contact owner: {!Contact.Owner.Email} <br/>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>
----------------------

 
Shivam KesharwaniShivam Kesharwani
Hi Diego,

Try this code,it  will surely works,,,,

<apex:page standardController="Contact">
<apex:form >
    <apex:pageBlock title="Contact Summary">
        <apex:pageBlockSection >
            <apex:inputField value="{! Contact.FirstName }"/> <br/>
            <apex:inputField value="{! Contact.LastName }"/> <br/>
            <apex:inputField value="{! Contact.Owner.Email }"/> <br/>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form>
</apex:page>
Shubham Hajare 1Shubham Hajare 1
bound variable is noting But our Contact's Controller
---------------------------------------------------------------------------------------------------------------------------------------

<apex:page standardController="Contact">
    <apex:pageBlock >
                <apex:pageBlockSection >
                              <apex:pageBlockSectionItem > 
                                     First Name:  {!Contact.Firstname}
                              </apex:pageBlockSectionItem>
                              
                              <apex:pageBlockSectionItem > 
                                      Last Name:  {!Contact.Lastname}
                              </apex:pageBlockSectionItem>
                              
                              <apex:pageBlockSectionItem > 
                                       Emailid:    {!Contact.Owner.Email}
                              </apex:pageBlockSectionItem>         
                </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>