• Rakesh Boinepalli
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I have two objects A & B.  B is child of A in lookup relationship. There are existing complex triggers on both of these objects. One of the thing which trigger on object A does is whenever field xyz changes; it updates all the child object B records with the new value of field xyz. (Both of these objects have field xyz which is long text area.)
As per new requirement, I have to track field history for both of the above objects in custom object (history object C). So I wrote some complex logic to track the history which gets called from object A and Object B trigger. This works fine except one scenario where if I change field xyz on object A and one of the  object B child record is erroneous (data does not meet vaidations - coded in before trigger). In this case my history records are not created for any of these object B child records including erroneous and non-erroneous records. When I put debug after insert statements, I can see that even SF ID's are created for these history records. When I search a record with that SF ID , it says that 'the data you are trying to access could not be found...'. (Note: I use some static maps to avoid duplicate history record creation because of recursive trigger; in case if it matters).  Please let me know if anyone has come across this situation before.
  • February 14, 2016
  • Like
  • 0