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
ErrorProneErrorProne 

Parent Child Relationships.

Not sure if this is possible.

 

I have a custom object that is a has a master detail relationship to the account object.

 

Is it possible to create a form in the child object that changes the values in the fields on the parent? This code doesn't seeem to work.

 

<apex:form>
<apex:pageBlock>
<apex:pageBlockButtons><apex:commandButton value="Save" Action="{!save}" styleClass="button"/><apex:commandButton value="Edit" Action="{!edit}" styleClass="button"/></apex:pageBlockButtons>
<apex:pageblockSection>
<apex:outputField value="{!Account_Management__c.Account__r.Type}"/>
</apex:pageblockSection>
</apex:pageBlock>
</apex:form> 

 any help would be amazing. Thanks

bob_buzzardbob_buzzard

You can do this, but you'll have to save the values from the related account in a custom or extension controller, as the standard controller save only updates the main record, it doesn't traverse the object graph.