• Ben Huri
  • NEWBIE
  • 10 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
Hey guys, what is your best suggested way to delete a record with it's related lists and it's look up fields??

I thought to query all records with SOSL by the record Id, but i found out it is not possible (Or there's a way?).

Another option is quering all related lists (with inner loops) and then loop on all related lists (with getPopulatedFieldsAsMap() and delete them list by list.

I would love to hear your best solution in performence terms.

Thanks!
 
Hey guys, what is your best suggested way to delete a record with it's related lists and it's look up fields??

I thought to query all records with SOSL by the record Id, but i found out it is not possible (Or there's a way?).

Another option is quering all related lists (with inner loops) and then loop on all related lists (with getPopulatedFieldsAsMap() and delete them list by list.

I would love to hear your best solution in performence terms.

Thanks!