• zachumen
  • 0 Points
  • Member since 2012

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 2



I have two custom objects 'Contact__c' and 'Gift_Aid__c' where a Contact object can have multiple Gift Aid records.

A look up relation has been created from 'Gift_Aid__c' on 'Contact__c'.


I have  a VF page where I am using the fields of both the objects. When I save the page, a Contact and a Gift Aid record associated with the contact needs to be created.


Can anyone please provide me a sample controller code for the above scenario.


Any help regarding this will be highly appreciated.



What are my options, if any, to programmatically determine what Master/Detail or Lookup relationships a particular Object is involved in?


We would like to prevent users from deleleting an Account (for example) that is involved in the above relationships. We would prefer not to hard code the existing relationships but rather determine them dynamically so that we don't need to continually update the code as we add objects to our system.



  • August 24, 2009
  • Like
  • 0