You need to sign in to do that
Don't have an account?
Need help with apex test class on account
public with sharing class AccountFinal
{
public account acc{get;set;}
public List<selectoption> so{get;set;}
public String city{get;set;}
public AccountFinal(Apexpages.standardcontroller controller)
{
id id1 = ApexPages.currentPage().getParameters().get('recordtype');
string s = ApexPages.currentPage().getParameters().get('recordTypeName');
id id2 = Apexpages.currentpage().getparameters().get('id');
so = new list<selectoption>();
acc = (account)controller.getRecord();
if(id2 != null){
acc = [select name,fax,type,billingcity from account where id=:id2];
city= acc.billingcity;
}else{
acc.recordtypeid = id1;
If(s=='abc')acc.type='est';
else acc.type='Customer';
so.add(new selectoption('--None--','--None--'));
}
}
public pagereference save()
{
try{
acc.billingcity = city;
if(acc.billingcity == null || acc.billingcity ==''){
acc.addError('city is a required field');
return null;
}
upsert acc;
return (new Apexpages.standardcontroller(acc).view());
}
catch(exception e){
ApexPages.addMessages(e);
return null;}
}
public void pocode(){
postal_code__c pc= [select name,city__c from postal_code__c where id=:acc.Postal_Code_Number__c];
acc.billingcity=pc.city__c;
}
}
..