• abc batch
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

I've created a custom object that stores data for a record, including it's location (via latitude/longitude). I need to add this for a number of standard records including Leads, Contacts and Accounts. I'd like this in a single object for performance reasons. For example, now I can query what standard records are in a given area in a single query rather than querying each of Leads, Accounts, Contacts etc. separately. 

 

Conceptually, I'm looking for the equivalent of a master detail relationship to my custom object. However, I had to implement this as a lookup relationship as master-detail isn't supported for all records (e.g. can't have a master detail relationship from Leads to my Custom object). To this end, I had to implement my own triggers, e.g. to delete row in the custom object if the "parent" is deleted. 

 

As I mentioned, I'd like to make a single query to my custom object from Apex rather than make a bunch of queries to the parent records. However, now I'm concerned about security - that a user can get back records that they otherwise wouldn't have permission too. Is there any way to grant a row being inserted in my custom object the exact same permissions as on a "parent" object (I have access to the parent SObject when I'm inserting the custom object record)? Are there big gotchas in this approach (e.g. that permissions on the parent object could change and not ripple through?).

 

 

  • July 09, 2010
  • Like
  • 0