Skip to main content
2 个回答
  1. 2019年10月10日 14:15
    Hi Ahmed,

    ANS: Static Resources.

    Loading Test Data :

    Using the Test.loadData method, you can populate data in your test methods without having to write many lines of code.

    Follow these steps:

    1. Add the data in a .csv file.
    2. Create a static resource for this file.
    3. Call Test.loadData within your test method and passing it the sObject type token and the static resource name.
    For example, for Account records and a static resource name of myResource, make the following call:

    List<sObject> ls = Test.loadData(Account.sObjectType, 'myResource');

    More info : https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_load_data.htm

    Hope this helps you!

    If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.

    Salesforce Freelance Consultant/Developer/Administrator/Trainer

    @For Salesforce Project Support: salesforcestart1@gmail.com

    Salesforce latest interview questions and training videos :

    https://www.youtube.com/channel/UCOcam_Hb4KjeBdYJlJWV_ZA?sub_confirmation=1

    Thanks,

    V Varaprasad

    Email: salesforcestart1@gmail.com​​​​​​​
0/9000