+ 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.