+ Start a Discussion

Managed Packages and Customer Validation Rules / Required Fields

I've had this discussion in the past with a few people at Salesforce.com and at the time there was no resolution to this issue.  If you're publishing a managed application that includes triggers on standard objects, how can your unit tests account for or bypass the customer's custom validation rules?


For example, if I have a trigger on the account object and my unit test inserts a new account to get the required test coverage, how do I allow for a customer who has a custom required field or a validation rule on a specific field that can't be known about during creation of the managed package?  Currently this would cause the unit test to fail.


Failed unit tests can be ignored for installation of managed packages, but they can't be ignored when a customer is deploying code from a sandbox/DE org to a production org or when migrating change sets from sandbox to production in an org with a managed package already installed that has failing unit tests. 




E.J. Wilburn,


      Did you find the solution for the failed unit tests..? 




That's an unfortunate oversight in Salesforce testing framework.

Vote for this idea: