1

We have developed the managed app and we are ready to move to any other org. Since we are using some custom objects and we have loaded some pre-defined data into one object and we want that data should also deployed to another org when app is installing. How can we achieve this?

1

This is a very common question for all developers working on Managed Packages. There are multiple approaches to do this.

  1. Post Install Script : You can create a post install script to populate data once your package is installed. You can create a utility class which will populate all data for you and execute this class from Post Install Script

    Ref : https://help.salesforce.com/apex/HTViewHelpDoc?id=apex_post_install_script_intro.htm&language=en

  2. Configure Page : You can display a configure page as your default Home after installation. User can simply click a button and it will either execute a class or fetch a static resource which has data in XML/JSON format and creates it for you.

  3. Custom Metadata : Salesforce has introduced this latest feature for migrating data along with the package. The sole purpose of custom metadata is to use of configurations, but you can use it for data migration as well.

Ref : https://developer.salesforce.com/blogs/engineering/2015/04/custom-metadata-types-ga.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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