function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
EJWEJW 

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. 

 

Thanks, 

Seek84Seek84

E.J. Wilburn,

 

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

 

Thanks.

maximummaximum

That's an unfortunate oversight in Salesforce testing framework.

Vote for this idea: 

http://sites.force.com/ideaexchange/ideaView?c=09a30000000D9xt&id=08730000000BrpCAAS