function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ken Koellner 1Ken Koellner 1 

loading test data from .csv static resources set relationship lookup fields.

I haven't used the feature where test data in Apex Test methods is load from .csv files in static resources.  I would assume it just does simple field assignments.  I'm curious if there's a way to set lookup/master-detail relatinship fields during the load (like an upsert in DataLoader that can use External Id fields).

I would think if you want to load parent table related child , you'd that functionality like that.  You might be able to work around by doing the loads, then running some setup code in Apex to link the objects using the natural keys to build a map and then set an Id.  But that would only work for lookup, not master-detail.