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
WannaKnowWannaKnow 

Saving Child records

Hi,

 

I have a page with Account as standard controller. But in that page, I want to save the record of the child of account. So I have created an extension but my save function is not getting called. Am I missing something here?

 

  public PageReference mySave()
    {
        Pagereference pr;
        system.debug('=================='+Address);
        system.debug('=================='+Follow_up);
        system.debug('=================='+acct.ID);
        objMed.Address__c = Address;
        objMed.Follow_up_Method__c = Follow_up;
        objMed.Account__c = acct.ID;
        insert objMed;
        return pr;
    }

 

Please help.

ForceComForceCom

Did you use the command button attribute on the visualforce page. 

 

<Apex:command button value="Save" action="{!mySave}"/>

WannaKnowWannaKnow

yes...ofcourse....


ForceCom wrote:

Did you use the command button attribute on the visualforce page. 

 

<Apex:command button value="Save" action="{!mySave}"/>


 

ForceComForceCom

Try this:

 

PageReference pr=new pagereference('apex/samplepage');

SFDC_EvolveSFDC_Evolve

Could you please post the code of the VF page also . . 

 

Thanks 

SFDC_Evolve