You can fixe the issue by overriding the mapEntityToDataSource method in his Data Entity extension and calling next mapEntityToDataSource() as the first line inside the method. This allowed the standard DMF mapping to run before his custom logic. After that, he checked the database operation type and the correct data source, retrieved the target table buffer, and manually assigned the custom field value from the Data Entity to the target table:
public void mapEntityToDataSource(DataEntityRuntimeContext _entityCtx,
DataEntityDataSourceRuntimeContext _dataSourceCtx)
{
// Run standard mapping first
next mapEntityToDataSource(_entityCtx, _dataSourceCtx);
// Run custom code only for specific operations
if (_entityCtx.getDatabaseOperation() == DataEntityDatabaseOperation::YourOperation)
{
// Execute logic only for the correct table source
if (_dataSourceCtx.name() == dataEntityDataSourceStr(YourEntity, YourEntityDataSource))
{
// Get the target table buffer
YourEntityDataSourceTable buffer = _dataSourceCtx.getBuffer();
// Map custom field to target table
buffer.TableCustomField = this.EntityCustomField;
}
}
}