In a form like LedgerJournalTransDaily, there is a field Txt imported from LedgerJournalTrans. Using the JournalNum, I need to go to LedgerJournalTable and get the Name field.
I've written a display method like follows:
[SysClientCacheDataMethodAttribute(true)]
public display Name GetLedgerJournalTableName()
{
LedgerJournalTable ledgerJournalTable;
Name ret;
select firstFast firstOnly ledgerJournalTable
where ledgerJournalTable.JournalNum == this.JournalNum;
ret = ledgerJournalTable.Name;
return ret;
}
To be honest, I am not sure if this is fast enough or if there is another way to do it. Please give me a hint.
return LedgerJournalTable::find(his.JournalNum).Name;- Jan B. Kjeldsenselect firstFast firstOnly name from ledgerJournalTable where ledgerJournalTable.JournalNum == this.JournalNum;with an index on journalnum and name as an included column could make sense as you can turn it into a field select. That's paying for performance with readability coins though - Tom V