
3 answers
Hi ,Yes we can create a custom button which can perform multiple action. I just tested it in dev console.You are missing the DML statement here in the save method.Use Insert,Update or (insert and update both ) based on your requirement. Please comment if you find this helpful.Thanks!!!.
public PageReference save(){
Upsert acc;
PageReference reRend = new PageReference('/apex/ThankYou');
reRend.setRedirect(false);
return reRend;
}