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
Sean GilmartinSean Gilmartin 

Salesforce App Installation Issues

We have been having trouble downloading and opening apps from the Salesforce AppExchange on our system. For example, we go to the AppExchange, click Get It Now, go through the steps for installing an app, receive an email saying it has been installed but needs to go through some more steps to be successfully deployed, and when we go to the Deployment tab in Setup see that each app is failing to deploy successfully by failing on the Run APEX tests step. The error messages are pointing to problems between APEX coding and our Opportunity triggers. It says that there is Code Coverage Failure, and that our Opportunity trigger has 0% code coverage when it needs at least 1%. Example of a specific error message:

System.AssertException: Assertion Failed: Pre deploy test failed, This may be because of custom validation rules in your Org. You can check ignore apex errors or temporarily deactivate your validation rules for Opportunitys and try again.
Stack Trace: Class.ActionPlansTestUtilities.createNewOpportunity: line 260, column 1 Class.ActionPlanCreationController.checkReferedObject: line 918, column 1

Can anyone help us with this issue?
Best Answer chosen by Sean Gilmartin
Always ThinkinAlways Thinkin
It certainly seems likely that Action Plans V3 was getting in the way, it has pretty elaborate tests on Opportunities that could be derailed by any Validation Rules you've created. The good thing about an unmanaged version is that you could edit the Unit Tests in Action Plans to accomodate your customizations if you do in fact need that app in the future. I'm working on a lighter-weight version in a github fork (https://github.com/AlwaysThinkin/ActionPlans) that would assign only one Action Plan to an Opportunity or Lead so that the app isn't as data storage greedy.

All Answers

Always ThinkinAlways Thinkin
Hi Sean,
I suppose the first question is of the "Is the unit plugged in?" variety: do all your unit tests pass when you Run All Test from Setup > Develop > Apex Test Execution?

I've been working with the Action Plans app quite a bit lately myself, modding it for our needs, so I know that it can deploy reliably.
Sean GilmartinSean Gilmartin
Hi, 

We actually uninstalled an app called Action Plans V3 Unmanaged and this allowed us to start successfully installing other Apps and having them deploy successfully. I ran the Apex test executions and all unit tests are passing now. So perhaps this App was causing all the problems?
Always ThinkinAlways Thinkin
It certainly seems likely that Action Plans V3 was getting in the way, it has pretty elaborate tests on Opportunities that could be derailed by any Validation Rules you've created. The good thing about an unmanaged version is that you could edit the Unit Tests in Action Plans to accomodate your customizations if you do in fact need that app in the future. I'm working on a lighter-weight version in a github fork (https://github.com/AlwaysThinkin/ActionPlans) that would assign only one Action Plan to an Opportunity or Lead so that the app isn't as data storage greedy.
This was selected as the best answer
Sean GilmartinSean Gilmartin
Thank you for the detailed solution to our problem. I think for the time being we do not need to run that App. If we are going to use it again in the future we will definitely look into editing the Unit Tests or  I will also keep a lookout for the App you are developing as well.