Is your feature request related to a problem? Please describe.
Sometimes you need to explicitly split record updates into "custom" buckets or impose an order of Operations that is not strictly based on Record dependencies.
e.g.
Automating permission management including Profile (licence) swap. We have to ensure this order:
- Delete Permission Set (Group) Assignments
- Delete Permission Set Licence Assignments (SF does not always do this automatically)
- Update User Profile
- Insert Permission Set Licence (not All PS will grant licence automatically)
- Insert Permission Set (Group) Assignments
Different order can fail, though we still want this to be one atomic operation.
Describe the solution you'd like
a) re-introduce Custom Order - would support above scenario as long as we do not need custom buckets within SObject (unlikely)
b) add "Generic Work" option, similar to ApexCommon's fflib__SObjectUnitOfWork.registoerWork(IDoWork) which will allow "chaining" two instances of DML
e.g.
static DML dmlWork = new DML();
static DML secondPassWork = new DML();
...
register stuff
...
dmlWork.toSave(secondPassWork);
dmlWork.commitWork();
Is your feature request related to a problem? Please describe.
Sometimes you need to explicitly split record updates into "custom" buckets or impose an order of Operations that is not strictly based on Record dependencies.
e.g.
Automating permission management including Profile (licence) swap. We have to ensure this order:
Different order can fail, though we still want this to be one atomic operation.
Describe the solution you'd like
a) re-introduce Custom Order - would support above scenario as long as we do not need custom buckets within SObject (unlikely)
b) add "Generic Work" option, similar to ApexCommon's
fflib__SObjectUnitOfWork.registoerWork(IDoWork)which will allow "chaining" two instances of DMLe.g.