Tutorial #8: Inputting Data with Forms shows how to create a very simple form. In this lesson you will duplicate that page, adding the extension functionality:
- Create a new Visualforce page called MyAccountWithExtension.
- Use the following as the body of the page:
<apex:page standardController="Account" extensions="MyExtension"> <p>{!title}</p> <apex:form> <apex:inputField value="{!account.name}"/> <apex:commandButton action="{!save}" value="Save!"/> </apex:form> </apex:page>
- Now access your page with a valid Account identifier passed in as a parameter. Your URL will look something like:https://na6.visual.force.com/apex/MyAccountWithExtension?id=0018000000MDfn1
What you’ll find is that your form pre-populates the input field with the name of the identified account. Great! And it also shows your fancy title with the account name and identifier.
When you save the page, you’ll notice that a new line appears above the form. Here’s what’s happening in your page:
- The attribute extensions="MyExtension" ensures that Visualforce instantiates a copy of your Apex class MyExtension, passing in a reference to the current controller (you’re using the standard controller for Account).
- The syntax {! title} instructs Visualforce to look for a method called getTitle() and insert the result of calling that method. Because there is such a method in your extension, Visualforce executes it and replaces the statement with the result.
Interesting to learn Salesforce
ReplyDeleteNice. Thanks for Salesforce Online Training a good blog SalesForce Online course Hyderabad
ReplyDeleteNice post. very useful and informative.keep sharing
ReplyDeleteSalesforce training
Nice post. very useful and informative keep sharing
ReplyDeleteSalesforce training
I was looking for this script that for sharing. If you are looking for Best Salesforce Training Institute in Noida then CIIT Noida should be your first priority.
ReplyDeleteNice Post Thanks for sharing...
ReplyDeletesoftware training institute
best devops training in hyderabad
full stack developer course
Prefer to study this kind of material. Nicely written information in this post, the quality of content is fine and the conclusion is lovely. Things are very open and intensely clear explanation of issue.
ReplyDeleteSaleforce Training in Gurgaon
Saleforce Developer Training in Gurgaon
Thank you for sharing such a nice and interesting blog with us. I have seen that all will say the same thing repeatedly. But in your blog, I had a chance to get some useful and unique information.
ReplyDeleteSaleforce Training in Gurgaon
Saleforce Developer Training in Gurgaon
Salesforce lightning training in Gurgaon
Salesforce Einstein training in Gurgaon
Salesforce integration training in Gurgaon
AlmaMate offers the best Salesforce training in Noida. It is actually regarded as one of the best training institutes in
ReplyDeleteNoida for Salesforce. We offer best-in-class SFDC development training not only in Noida but in pan India location. The
Salesforce training provided by us is devised to make you ready to deploy.
Our Salesforce training is aligned with the industry standards and it has been designed in keeping in view all the
necessary inclusions. AlmaMate ensures 100% placement assistance after successful completion of your training. If you are
looking forward to making your career in the Information Technology domain then join the best Salesforce training in
Noida.To get further details of our services simply decision India at: (Toll Free) US: +91 9315269123
Best Salesforce Training in Noida
Best Salesforce Training in Delhi
Salesforce Training in Noida