You need to sign in to do that
Don't have an account?
Gaurav Raj
Rectify the error in the code
public class customAccountController{
public Account ac {get;set;}
Id accId = apexpages.currentpage().getparameters().get('id');
Account acc = [select Name,AccountNumber, Site,NumberOfEmployees,Fax,Ownership,Industry from account where id=:accid];
}
VF page:
<apex:page showHeader="false" controller="customAccountController" title="My Account" >
<div class="panel" id="acctDetail" selected="true" style="padding: 10px;
margin-top:-44px" title="Account Information" >
<h2>{!Account.Name}</h2>
<fieldset style="margin: 0 0 20px 0;">
<div class="row">
<label>Phone:</label>
<input type="text" value="{!Account.Phone}" />
</div>
<div class="row">
<label>Rating:</label>
<input type="text" value="{!Account.Rating}" />
</div>
</fieldset>
</div>
</apex:page>
controller:
You were trying to access "Account" instead of "ac", but you didn't actually need the custom controller at all-- a standard controller is just fine here. You can use an "extension" if you need to add custom logic beyond querying basic data or saving the record.
Hiow to go about writing its extension?
No extension is needed for this particular piece of code. You would use an extension to add functions not already available in Visualforce.
The extension would start of as: