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

AXmodel file import in D365 F&O

 ModelUtil.exe -import -metadatastorepath=k:\aosservice\packageslocaldirectory -file=C:\Temp\DEST.axmodel