function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Olivia FordeOlivia Forde 

Will a standard save button save child items

I have a VF page and the save button saves the data but not the data to the child object
Shaijan ThomasShaijan Thomas
Standered SAVE Button save only the standared object Data.
Thanks
Shaijan
Olivia FordeOlivia Forde
Anyone know how to do that?
KaranrajKaranraj

You have to override the save button using extension to include your custom business logic.Below is the sample controller code to overide the Save button
public class MyControllerExt {
 
 private final Account accObj;
 public MyControllerExt (ApexPages.StandardController stdController) {
    this.accObj= (Account)stdController.getRecord();
  }

 public PageReference save(){
       //Write your business logic to insert/update child accounts
        return null;
  }
}

Check this link to know more details about controller extension in salesforce http://www.salesforce.com/docs/developer/pages/Content/pages_controller_extension.htm