Tag Archives: ApexPages.StandardController

Add Fields in ApexPages.StandardController

If you want any fields value then you need add the field API name in standard controller.

public with sharing class AccountControllerExt
{
	public Account acc {get;set;}
	 
	public AccountControllerExt(ApexPages.StandardController stdController)
	{
		stdController.addFields(new List<String>{'Name', 'Region__c', 'TAX_ID_Number__c'});
		this.acc = (Account)stdController.getRecord();
	}
}