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
sadhasivamsadhasivam 

salesforce Static resource based test-case data

Hi Friends,

 

We are trying to levarage salesforce winter 13 release static resource based csv driven test case data setup. Would like to know  few things

 

1. how to establish foreign key relationship in the static resource. ?

2. single csv static resource can have data-set related to a table ? for,.eg) if we have 3 custom table then we need to have 3 different csv static resource loaded to load data is it. 

3. is there any govenor limits in providing the data set. if so where can is see the limits information. 

 

donmacdonmac

Hi, good question. Currently, we write a whole lot of code that is simply there to construct test records. LoadData test method promises to help do away with much of that but it seems like it falls over when you need to link the test data to other objects (which is more often than not the case). Anyone have a solution to this?

 

One thought I had that others may like to comment on... If you make lookup fields not required and then set them in a before insert trigger based on the value of an external id, perhaps you can use that as a way of populating the lookups when the records are written. 

 

Alternatively, Salesforce could allow something like the foreign key references that the data loader accepts.

 

TIA for any help!