11 December 2017

AX 7 Dynamics 365 operations display methods

[ExtensionOf(tableStr(LedgerEntryJournal))] // this refers to table extension
final class TTLLedgerEntryJournal_Extension // class name must post with _Extension
{

[SysClientCacheDataMethodAttribute(true)]
public static display Name journalName(LedgerEntryJournal _this)
{
return LedgerJournalTable::find(_this.JournalNumber).JournalName;
}

[SysClientCacheDataMethodAttribute(true)]
public static display Name journalDescription(LedgerEntryJournal _this)
{
return LedgerJournalTable::find(_this.JournalNumber).Name;
}

}

==========

[ExtensionOf(tableStr(LedgerEntryJournal))] // this refers to table extension
public static class TTLLedgerEntryJournal_Extension // class name must post with _Extension
{

[SysClientCacheDataMethodAttribute(true)]
public static display Name journalName(LedgerEntryJournal _this)
{
LedgerEntryJournal:: // can call the static methods what we defined in the current class/Table
return LedgerJournalTable::find(_this.JournalNumber).JournalName;
}

[SysClientCacheDataMethodAttribute(true)]
public static display Name journalDescription(LedgerEntryJournal _this)
{
return LedgerJournalTable::find(_this.JournalNumber).Name;
}

}

No comments:

Post a Comment

Give me the commetns and solutions

Ledger Voucher creation Framework and x++ code to create ledger voucher

 Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension-...