I want to update the name field of newly inserted record with auto number field value.But auto number field is showing as null.But when I see the account record I could see the value of auto number field value on account page.
public PageReference MakeAnonymous(){
Account acc = new Account(Name='Anon');
insert acc;
system.debug('account number..'+ acc.Auto_Number__c);
acc.Name = acc.Name + '-'+ acc.Auto_Number__c;
update acc;
}