Objects involved A, B and C.
Scenario:
I'm inserting A record which in turn inserts B Record(Happen at after insert trigger of A).
Now Lets say B trigger insert C record (Off course after insert trigger of B ).
Now I have a look up on C record to A record and able to put it to C record lookup filed by passing as a parameter (Id of A record).
The challenge I'm facing here is at C trigger I have a map where I wish to build <Key = Id of A record and Value as A record.> => Here I'm querying for A record all required fields, But query returns null !.
Can someone please explain am I missing something in Order of Execution ? (A record is not yet committed to data base but since it's in after context Id is generated and Can't I query it until record is committed to database ?)
Thanks in advance.
Update:
This was failing because run as is being doing as guest user.