VIEW field creation

Hi,

Below is the sample code used to get value in field(unbound) which is created at VIEW level based on other fields. 

Requirement is, in VIEW we need to have Remain field(which is not in DS table) value based on AmountMSt and SettlesAmountMST fields. 

Create new REAL field at VIEW field level and link this method in “ViewMethod” properties of that field. when you open the view the data will come automatically based on below logic. 

Public Server Static str Remain()
{
DictView dv = new DictView(tableNum(IntCustTransView));
str amount = dv.computedColumnString(identifierStr(custTrans),
fieldStr(CustTrans, AmountMST));
str settleAmt = dv.computedColumnString(identifierStr(custTrans),
fieldStr(CustTrans, SettleAmountMST));

return SysComputedColumn::subtract(amount,settleAmt);
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s