Timeline for SOQL query produces results in Execute Anonymous, but returns zero records when running a test
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 20, 2014 at 0:21 | comment | added | Daniel Ballinger | Possible duplicate of When testing can I not use existing Data? | |
May 14, 2014 at 22:54 | vote | accept | vlr | ||
May 14, 2014 at 0:20 | comment | added | Daniel Ballinger | No problem. This is a fairly common problem for people to encounter when starting out with tests. If you don't know it is occurring it can be hard to tell what going on. Note that this question may or may not be marked as a duplicate based on this being a very common problem. No offence I hope. | |
May 14, 2014 at 0:17 | answer | added | Daniel Ballinger | timeline score: 6 | |
May 13, 2014 at 23:01 | comment | added | Daniel Ballinger |
Is your test class using @IsTest(SeeAllData=true) ? By default a test class can't see the data within an org. Ideally you would script in the required testing data.
|
|
May 13, 2014 at 22:56 | history | asked | vlr | CC BY-SA 3.0 |