As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [test-data]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
64 views

How to handle namespace for Test.loadData method

I am trying to insert test data with Test.loadData for custom object with fields in my managed package. The problem is my developer org do not have a namespace and packaging org has it. How we can ...
Ferhat Özsavran's user avatar
1 vote
2 answers
3k views

Test Data - Static Resources

I have many custom objects with lots of relationships and i want to create some test data for my test classes. For example, i have the Objects Account Opportunity Basket Product Configuration Product ...
Giorgos Galaios's user avatar
0 votes
1 answer
96 views

Is it possible to use another name for the TestDataFactory class

I have followed the trailheads for making a TestDataFactory. In the documentation it states that the TestDataFactory is a special class used for testdata. What isn't clear to me is can I change the ...
Thomas's user avatar
  • 2,284
1 vote
1 answer
482 views

Updating Object during isUpdate and isBefore trigger

I have a trigger that fires on the event trigger.isUpdate && trigger.isBefore for the Account object. In this trigger, I need to update a field in the Account object. I tried to add an update ...
Douglas's user avatar
  • 45
1 vote
1 answer
3k views

Is there a way to insert data with specific IDs?

I'm not sure if I'm explaining this correctly but I'll give it a shot. I'm trying to use Data Loader to insert CSVs of data into a Partial Pro sandbox, but I want these inserted records to use the ...
Sovereignty's user avatar
6 votes
2 answers
1k views

Test Failed 'Validation Errors While Saving Record(s)' when loading Accounts with Test.LoadData

Background When I use the Test.LoadData method to load Account records: List<Account> accountList = (List<Account>) Test.loadData(Account.sObjectType, 'account_test_data'); I get this ...
Robs's user avatar
  • 8,907
2 votes
1 answer
3k views

Error System.SObjectException: Business Account may not use Person Account field PersonHomePhone when loading Person Accounts using Test.LoadData

I get this error message: System.SObjectException: Business Account may not use Person Account field PersonHomePhone When I try and load Person Accounts using Test.LoadData() below is the data: ...
Robs's user avatar
  • 8,907