• 19872
  • NEWBIE
  • 0 Points
  • Member since 2013

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

I have some tests running for a Trigger (before insert), where I set some lookup fields (based on some logic from other fields).

 

Through debugging, I can see that the fields are set properly within my Trigger (let's call this field LookupField__c).

 

However, in my test class, if I query the inserted records [select Id, LookupField__c from Sobject where Id = :insertedRecord.Id], the LookupField__c is null (even though in the Trigger, I can see it was set).

 

The field is not touched anywhere else.  Is there a reason I can't query on this in the Test Class?  I could have sworn I used to be able to do this.