1. Calculate field in View using SysComputedColumn code.
public
static
server str getOutstanding()
{
return
strFmt(
"Sum(%1) + Sum(%2)"
,
SysComputedColumn::returnField(
tableStr(TIDIndentOrderUninvoiceTrans),
identifierStr(TIDIndentOrderPaymentTrans),
fieldStr(TIDIndentOrderPaymentTrans, amountTendered)),
SysComputedColumn::returnField(
tableStr(TIDIndentOrderUninvoiceTrans) ,
identifierStr(TIDIndentOrderPaymentTrans),
fieldStr(TIDIndentOrderPaymentTrans, grossAmount)));
}
2. Convert null Date to Max Date in view using SysComputedColumn code.
public
static
server str ReleasePostingDate()
{
return
SysComputedColumn::
if
(
SysComputedColumn::isNullExpression(SysComputedColumn::returnField(
tableStr(TIDAPUninvoiceConsignmentItem) ,
identifierStr(LedgerJournalTableRealease),
fieldStr(LedgerJournalTable, PostedDateTime))),
SysComputedColumn::cast(strFmt(
"'%1'"
,DateTimeUtil::date(DateTimeUtil::maxValue())),
'NVARCHAR'
),
SysComputedColumn::cast(SysComputedColumn::returnField(
tableStr(TIDAPUninvoiceConsignmentItem) ,
identifierStr(LedgerJournalTableRealease),
fieldStr(LedgerJournalTable, PostedDateTime)),
'NVARCHAR'
)
);
}
3.