+ Start a Discussion

Upon installation of app, want to write some custom app settings based on organization



I've developed a managed package. During installation is it possible to get the OrganizationType field (Enterprise, Pro, Unlimited etc) and write it to a custom app setting (cached) so that I can read it later on without doing a query. Basically I want to put branches in the code saying


if(OrganizationType == Enterprise)

 Do something

if(OrganizationType == Professional)

 Do something else


If there is an easy way to do this and set it that would be great. I don't know much about Global variables but I would even be open to using that if there is not other way. The point is, I don't want to run the same query in four different trigger types (example: Before Insert, After Delete, etc) when the value (OrganizationType) is static (baring an upgrade).


It would be great to just get it when I install they install the app and keep it as a custom setting. I'm open though...


We hit this repeatedly, and to be honest, it's going to be horrible for you...


You have to develop your "initialization" stuff in a class/page, and have the installing admin trigger it after install, or on first use of one of your pages.  You can't even populate the "defaults" for your custom settings out of the box without writing custom code.  Sorry to be blatantly negative here, but I guess I'm jaded from running into this specific issue, in managed packages, with custom settings, repeatedly.  It's to the point where one of my apps has more code in the controller that I had to build to manage the private custom settings, than it does in the rest of the application.


Good luck!


Sorry, blasted that too fast.


On top of not being able to pre-populate data during install, I'm pretty sure you can't determine org type/license type either.