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
Lam Ha TuanLam Ha Tuan 

How to insert a default record for custom objects while installing my app?

Hi guys, are there any way that when user install my app to their org, it will automatically insert some default record for that org? I also have an object to store personal settings for user, how can I create record for each user when they install my app? 
Thanks for you helps so much.
Best Answer chosen by Lam Ha Tuan
HarshHarsh (Salesforce Developers) 
Hi Lam,
  • Yes, this is possible using post-install scripts. 
  • Using the InstallHandler interface, you can specify the custom code that will be executed immediately upon the installation of the package. You can make a record for the custom setting in the post-installation script.
You can refer to the Stack Exchange link which has the same requirement.

https://salesforce.stackexchange.com/questions/11408/insertions-of-record-automatically-while-installing

Please mark it as Best Answer if the above information was helpful.

Thanks.