は、それらの1が、私は次のCustName
を示すCustAccount
の列を作成するフォームで、CustAccount
あります。表示方法の顧客名
私はdisplay
にCustAccountの選択に基づいて顧客名を入力します。私は、次のコードを含むテーブルCustTable
、上の既存の方法name
を使用してみましたが
:CustAccountの選択に基づいていないを除いてこれは、顧客名を表示し
display CustName name()
{
DirPartyTable dirPartyTable;
CustName custName;
boolean isSet = false;
try
{
if (this.hasRelatedTable(identifierStr(DirPartyTable_FK)))
{
dirPartyTable = this.relatedTable(identifierStr(DirPartyTable_FK)) as DirPartyTable;
//Check to make sure the fields we are accessing are selected.
if (dirPartyTable && dirPartyTable.isFieldDataRetrieved(fieldStr(DirPartyTable, Name)))
{
custName = dirPartyTable.Name;
isSet = true;
}
}
}
catch (Exception::Error)
{
isSet = false;
}
//If we aren't joined to DirPartyTable or it isn't selected, then do a query to get it.
if(!isSet)
{
custName = DirPartyTable::getName(this.Party);
}
return custName;
}
。新しいテーブルの新しいメソッドにコードをコピーすることを考えています。これを達成するためにコードを編集するにはどうすればよいですか?
もっと良い方法がありますか?
答えを受け入れることを検討してください。 –