Apex database layer for managed packages to simplify and enforce FLS
When writing a Managed Package, if you want to reach the AppExchange certified condition you will need to take special care with some code features like FLS.
Usually that requirement came up at the final stages of development and might have a several impact on the rollout date. Let me introduce this little DML class wrapper that enforce FLS with minimal impact on your code.
- Deploy this DB class into your packing/dev org
- Search in your whole code base for insert/update/upsert DML operations and substitute them to use DB.inserter/DB.updater/DB.upserter.
- There is no step 3, just save everything and run your test cases
Account a = new Account(
name = 'Nakatomi Inc'
);
insert a;
Account a = new Account(
name = 'Nakatomi Inc'
);
DB.inserter(a);
Use the Github Salesforce Deploy Tool link here while logged into your target org and follow instructions.