Create computed column in view or data entity with Sql statement
public static server str getHasBreakupDetails()
{
str expression;
expression = '(select count(bl.RecId) from EMSChargebackBreakupLines bl join EMSChargebackBreakupHeader bh on bl.BreakupHeaderRecId = bh.RecId and bh.ChargebackRecId = ' +
SysComputedColumn::returnField(tableStr(SAKChargebacksInquiryView),identifierStr(SAKChargebacks),fieldStr(SAKChargebacks,RecId)) + ')';
return SysComputedColumn::if(
SysComputedColumn::equalExpression(
expression,
SysComputedColumn::comparisonLiteral(0)), SysComputedColumn::returnLiteral(0), SysComputedColumn::returnLiteral(1));
}
Other examples
public static server str getCBNum(TableName _viewName,
str _DataSourceParty,
str _DataSourcePartyField)
{
str expression;
expression = 'select displayvalue from dimensionattributevaluecombination where recid = ' +
SysComputedColumn::returnField(_viewName,
_DataSourceParty,
_DataSourcePartyField);
return expression;
}
Comments
Post a Comment