Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public with sharing class myClass {
- private final Parent__c SiteP;
- public List<Child__c> childList {get; set;}
- public List<GrandChild__c> grandchildList {get; set;}
- public myClass (ApexPages.StandardController stdController)
- { SiteP = [SELECT Id, Name,Status__c FROM Parent__c
- WHERE Id =
- :ApexPages.currentPage().getParameters().get('id')];
- }
- //Public lists here for Child and Grandchild records//
- public PageReference saveAll() {
- update childlist;
- List<GrandChild__c> children = new List<GrandChildren__c>();
- for (Child__c c : childList) {
- grandchildlist.addAll(c.GrandChild__r);
- }
- update grandchildlist;
- update SiteP;
- return apexpages.currentpage();
- <apex:page standardController="Parent__c" extensions="myClass">
- <apex:form >
- <apex:commandButton value="Save" action="{!saveAll}"/>
- //Parent__c section here used from standard controller//
- //Child__c code section here used from extension//
- //GrandChild__c code section here used from extension//
- </apex:form>
- </apex:page>
Add Comment
Please, Sign In to add comment