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
softforcesoftforce 

Managed packaging: Handling required fields in standard objects

Our package creates Contact records driven by an integration component. When we deploy it in an Org with admin-created Contact fields that are 'required', what values shall we put on these fields? Of course, using describeSObjects() method, we can identify Required fields. And, we can insert random numbers or strings or dates onto those fields. This approach sounds ugly. Another option is to elicit appropriate values from the Admin via a Config page on the managed package. What is the best practice? Any thoughts...

IspitaIspita

Hi,

You can adopt the following approaches as per your convinience:-

  • Use random number and text combination to populate these fields (you undeline it as ugly)
  • Use a setting object which has data values in its records you can use data from this object for your purpose.
  • Also you can also make use of custom setting for your purpose

Hope this helps ? If not, let me know what didn't work, or if so, please mark it solved.