My team is working on an App that will eventually be on the App Exchange. Our normal SDLC is that our developers use git to retrieve code into their dev environment. We have a QA environment where their code is integrated using ant.

This QA environment is where we do our testing for each User Story. Deployment is quick with ant/jenkins.

However, once we get our code into our Packaging org and perform testing (every couple weeks or so), we encounter some issues that did not surface in our QA environment mentioned above. We'd prefer to catch any issue much sooner.

Therefore, we are trying to figure out the best way to set up a 'QA' environment that is Managed such that we find these issues sooner. What I've currently come up with is:

  1. Move code to Packaging Org
  2. Create new Beta Version from the Packaging Org
  3. Uninstall prior Beta Version from Test Org (this requires removing profile assignments from users, Delete records that have used Record Types, and a few other things.
  4. Install new Beta Version in Test Org. This requires several manual steps such as setting up profiles, custom settings, loading data for testing.

The steps above are quite cumbersome. We may try automating as much as possible. Ideally, I'd love to have a Test Org, where we can just keep installing our new builds. Problem is, we don't want to increase our Version Number.

What is your experience and best practice of testing managed packages as I've described?

  • 1
    Have you seen the SalesforceDX Pilot? It will allow you to spin up and then dispose of scratch orgs from source. True, it isn't generally available yet, but if you were going to build a whole lot of tooling to automate this it would be easier to wait for the Salesforce offerings in this area. Commented Mar 29, 2017 at 19:52
  • Thanks. Looks like I'm late to the party as far as signing up for the Pilot. Hopefully this will help us along once they release to everyone :) Commented Apr 5, 2017 at 14:42

1 Answer 1


I hope 'Post Install Scripts' can help to some extend to insert the data automatically after each install.

Reference: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_install_handler.htm

  • Excellent. I'll have the team take a look at this. Can you think of another way of managing our process other than the description I posted? Is that how you run your projects? Commented Mar 30, 2017 at 13:13
  • Pintu, some items that won't work on the above script is creating new profile, assigning packaged page layouts to the profile, adding SF Record ID to a few custom settings. Any thoughts on doing this--not sure it can be automated. How do you perform QA---just on unmanaged packages? Commented Apr 5, 2017 at 14:40
  • Regd. Profiles, ideal way is to create custom profiles in Subscriber Org( one time process), Add profiles to your Package and choose 'Install for specific profiles' option while install. It will allow you to merge the profile from package to custom profile you created in Org. Commented Apr 6, 2017 at 15:12
  • Regd. Assigning Record Id I hope you can do something in the code attached to install script to get it done. If records are created during the process, first insert records then get record id, and finally setup custom settings. If its from existing data, you can query it and assign. Not sure about yoir specific scenario. But i hope it can be done some way. Commented Apr 6, 2017 at 15:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .