Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I tried to set SeeAllData = true for the test method with OnInstall = true. But I was not able to save the test class if I use "@isTest(OnInstall=true,SeeAllData=true)", so I saved it with "@isTest(OnInstall=true)". The package installation failed in our client's org because I'm inserting Account, Contact, and Product records in my test method and their Contact trigger is throwing the error "System.QueryException: List has no rows for assignment to SObject" (the insert statement in my test method is firing our client's trigger and they are using a query in their trigger to retrieve an existing record with a specific value in Name field "[SELECT Id from Account WHERE Name = 'XXX' limit 1]"). If I can set SeeAllData = true, then my test method will not fail, so please help me with this. Thanks in advance.

share|improve this question
up vote 10 down vote accepted

Don't use a comma for the attributes:

@isTest(SeeAllData=true OnInstall=true)

As far as I can tell, this isn't documented anywhere.

share|improve this answer
It worked. Thanks @sfdcfox – ynl124 May 8 '14 at 20:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.