Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Dec 11th, 2017 53 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. public with sharing class myClass {
  2. private final Parent__c SiteP;
  3. public List<Child__c> childList {get; set;}
  4. public List<GrandChild__c> grandchildList {get; set;}
  5. public myClass (ApexPages.StandardController stdController)
  6. { SiteP = [SELECT Id, Name,Status__c FROM Parent__c
  7.                WHERE Id =
  8. :ApexPages.currentPage().getParameters().get('id')];
  9. }
  10.  
  11. //Public lists here for Child and Grandchild records//
  12.  
  13. public PageReference saveAll() {
  14.  update childlist;  
  15.  List<GrandChild__c> children = new List<GrandChildren__c>();
  16.      for (Child__c c : childList) {
  17.          grandchildlist.addAll(c.GrandChild__r);
  18.      }
  19.  update grandchildlist;
  20.  update SiteP;
  21.  return apexpages.currentpage();
  22.    
  23. <apex:page standardController="Parent__c" extensions="myClass">
  24.  <apex:form >
  25.     <apex:commandButton value="Save" action="{!saveAll}"/>
  26.  
  27. //Parent__c section here used from standard controller//
  28.  
  29. //Child__c code section here used from extension//
  30.  
  31. //GrandChild__c code section here used from extension//
  32.  
  33.  </apex:form>
  34. </apex:page>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top