Skip to content

Commit 7db6291

Browse files
committed
fix: When no dirty fields provided, overwrite the registered record
1 parent 2d7ad73 commit 7db6291

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fflib/src/classes/fflib_SObjectUnitOfWork.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ public virtual class fflib_SObjectUnitOfWork
260260
throw new UnitOfWorkException(String.format('SObject type {0} is not supported by this unit of work', new String[] { sObjectType }));
261261

262262
// If record isn't registered as dirty
263-
if (!m_dirtyMapByType.get(sObjectType).containsKey(record.Id))
263+
if (!m_dirtyMapByType.get(sObjectType).containsKey(record.Id) || dirtyFields.isEmpty())
264264
{
265265
// Register the record as dirty
266266
m_dirtyMapByType.get(sObjectType).put(record.Id, record);

0 commit comments

Comments
 (0)