1. 旧方法
Method:
display LogisticsAddressName dspDlvAddrName()
{
LogisticsAddressName dlvName;
LogisticsPostalAddress dlvAddress;
LogisticsLocation dlvLocation;
dlvAddress = LogisticsPostalAddress::findRecId(this.DeliveryPostalAddress);
dlvLocation = LogisticsLocation::find(dlvAddress.Location);
dlvName = dlvLocation.Description;
return dlvName;
}
在 FormDataSource 的 init() 的super(); 之后加
cacheAddMethod 申请
void init()
{
super();
this.cacheAddMethod(tableMethodStr(WMSOrder, dspDlvAddrName));
}
2. 新方法,利用 方法体上面的attribute 即可,不需要再在form的datasource的init事件中声明
[SysClientCacheDataMethodAttribute(true)]
display LogisticsAddressName dspDlvAddrName()
{
LogisticsAddressName dlvName;
LogisticsPostalAddress dlvAddress;
LogisticsLocation dlvLocation;
dlvAddress = LogisticsPostalAddress::findRecId(this.DeliveryPostalAddress);
dlvLocation = LogisticsLocation::find(dlvAddress.Location);
dlvName = dlvLocation.Description;
return dlvName;
}