Update the custom field in table during import in data management
Today we have a requirement to update the target table when record insert through data entity. so for that we have created a extension that helps us to do this customization
========================================================================
/// <summary>
/// UpdateEntitydatesource method help where there is any update opertaion on the inventable it will update the value.
/// </summary>
/// <returns>The collection.</returns>
[ExtensionOf(tableStr(EcoResReleasedProductV2Entity))]
final class AVAEcoResReleasedProductV2Entity_Extension
{
public boolean updateEntityDataSource(DataEntityRuntimeContext _entityCtx, DataEntityDataSourceRuntimeContext _dataSourceCtx)
{
boolean ignoreDataSource;
switch (_dataSourceCtx.name())
{
case dataEntityDataSourceStr(EcoResReleasedProductV2Entity, InventTable):
if( _entityCtx.getDatabaseOperation() == DataEntityDatabaseOperation::Update)
{
InventTable bufferUpdate = _dataSourceCtx.getBuffer();
bufferUpdate.AVAPartsSalesAnalyst = HcmWorker::findByPersonnelNumber(this.AVAPartsSalesAnalyst).RecId;
bufferUpdate.AVASQATech = HcmWorker::findByPersonnelNumber(this.AVASQATech).RecId;
bufferUpdate.AVACategoryManager = HcmWorker::findByPersonnelNumber(this.AVACategoryManager).RecId;
}
break;
}
ignoreDataSource = next updateEntityDataSource(_entityCtx, _dataSourceCtx);
return ignoreDataSource;
}
}
===========================================================================
Comments
Post a Comment