Background: We would like our managed package to create standard object records (Leads, Cases, Contacts) on behalf of the user, in Apex. Outside of dealing with the built-in required fields (e.g. LastName, Company for Leads), the code of course also has to contend with any custom required fields, unique fields, and validation rules that the customer may have installed on these objects.
Question: Should we (a) use techniques such as those discussed here and addressed in a github project here to handle required and unique fields? But then how to deal with validation rules that might cause inserts to fail? or (b) abandon the whole idea of creating records on behalf of the user without their input? or (c) ask the Admin to provide a list of field names and default values that the Apex code can use to create a proper, valid record of each type.
I'm thinking the only viable/user-friendly option is (b), but I'm really curious to hear from other ISV folks who have dealt with this problem. Thanks!