We will create computed column to show Name alias(Search name) on view CPTransView.
At first, create a method with named compColItemName with detail code like below
{
#define.ViewName("CPTransView")
#define.DataSourceName("CustPackingSlipTrans")
#define.FieldItemId("ItemId")
str sItem, translationSQL, ret;
DictView dictView;
;
dictView = new DictView(tableNum(#ViewName));
sItem = dictView.computedColumnString
(#DataSourceName,
#FieldItemId,
FieldNameGenerationMode::FieldList,
true);
translationSQL = strFmt("SELECT NameAlias FROM InventTable WHERE InventTable.ItemId = %1 AND DataAreaId = '%2'",
sItem, CompanyInfo::find().dataArea);
ret = strFmt("%1", translationSQL);
return ret;
}
that methode return field NameAlias on InventTable.
After it, right click on node Fields on CPTransView and then select New->StringComputed Column
then, set properties of that new field like a picture below
If all finished, try to open the view
0 comments:
Post a Comment