Skip to content

Commit 2d7ad73

Browse files
committed
fix: Remove breaking change where exception would be thrown if subsequent register dirty called without dirty fields specified
1 parent fea8037 commit 2d7ad73

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

fflib/src/classes/fflib_SObjectUnitOfWork.cls

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -270,13 +270,6 @@ public virtual class fflib_SObjectUnitOfWork
270270
// Update the registered record's fields
271271
SObject registeredRecord = m_dirtyMapByType.get(sObjectType).get(record.Id);
272272

273-
// If the caller has supplied a different instance of the same record with no list of updated fields
274-
if (dirtyFields.isEmpty() && registeredRecord !== record)
275-
{
276-
// Cannot determine what updates to make to the record (assuming updating nothing is incorrect)
277-
throw new UnitOfWorkException('Cannot determine what fields to update on record ' + record);
278-
}
279-
280273
for (SObjectField dirtyField : dirtyFields) {
281274
registeredRecord.put(dirtyField, record.get(dirtyField));
282275
}

0 commit comments

Comments
 (0)