Saturday, September 5, 2020

MapEntityToDataSouce logic with Skipping validation

 [ExtensionOf(dataentityviewstr(SalesQuotationLineCDSEntity))]
final class SalesQuotationLineCDSEntity_Extension
{
public void mapEntityToDataSource(DataEntityRuntimeContext entityCtx, DataEntityDataSourceRuntimeContext dataSourceCtx)
{
next mapEntityToDataSource(_entityCtx,_dataSourceCtx);
if (_entityCtx.getDatabaseOperation() == DataEntityDatabaseOperation::Insert)
{
switch (_dataSourceCtx.name())
{
case dataEntityDataSourceStr(SalesQuotationLineCDSEntity, SalesQuotationLineEntity):
SalesQuotationLineV2Entity salesQuotationLineEntity = _dataSourceCtx.getBuffer();

if (SalesQuotationLineEntity.LineCreationSequenceNumber)
{
salesQuotationLineEntity.LineNum = any2Real(SalesQuotationLineEntity.LineCreationSequenceNumber);
}
salesQuotationLineEntity.skipDataSourceValidateField(fieldNum(SalesQuotationLineV2Entity,LineNum),true);

break;
}
}
}
}

No comments:

Post a Comment

TFS Work space configuration

Refer below link:  https://d365byjp.blogspot.com/2018/10/steps-to-configure-tfsvsts-workspace-in.html