You need to sign in to do that
Don't have an account?
Sakthidasan
how to display record from vf page
I'm learning vf page.I am struggling display a record from vg page.I copy the id of the contact record and past in url like same(https://***Salesforce_instance***/apex/HelloWorld2?id=001D000000IRt53) but I'm not see the record in vf page.my code here:
<apex:page standardController="Contact">
<apex:form >
<apex:pageBlock title="Quick Edit: {!Contact.Name}">
<apex:pageBlockSection title="Contact Details" columns="1">
<apex:inputField value="{!Contact.Phone}"/>
<apex:outputField value="{!Contact.MobilePhone}"
label="Mobile #"/>
<apex:inputText value="{!Contact.Email}"
label="{!Contact.FirstName + '’s Email'}"/>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
<apex:page standardController="Contact">
<apex:form >
<apex:pageBlock title="Quick Edit: {!Contact.Name}">
<apex:pageBlockSection title="Contact Details" columns="1">
<apex:inputField value="{!Contact.Phone}"/>
<apex:outputField value="{!Contact.MobilePhone}"
label="Mobile #"/>
<apex:inputText value="{!Contact.Email}"
label="{!Contact.FirstName + '’s Email'}"/>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
Please save the VF Page by going to Setup --> Build --> Develop --> Visualforce Page
Because some times it will not take the Query string parameters when you use the editor from Developer Mode.
Regards,
Mahesh
All Answers
https://na1.salesforce.com/apex/HelloWorld2?id=001D000000IRt53
Look like ID you are passing for account(001D000000IRt53) contact id always start with 003.
Please find the below code:
I also tested the above code in my DE environment.
Go through the Trailhead module:
https://developer.salesforce.com/trailhead/en/visualforce_fundamentals/visualforce_output_components
Also go through the below links:
https://developer.salesforce.com/docs/atlas.en-us.apex_workbook.meta/apex_workbook/apex_visualforce_3.htm
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_display_field_values.htm
http://salesforce.stackexchange.com/questions/22947/visual-force-page-for-records-retrieval
Please do let me know if it helps you.
Regards,
Mahesh
Please save the VF Page by going to Setup --> Build --> Develop --> Visualforce Page
Because some times it will not take the Query string parameters when you use the editor from Developer Mode.
Regards,
Mahesh
after I save the page (Setup --> Build --> Develop --> Visualforce Page) I get the record from vf page