We can create extension for class but can use/call only Public Members/Methods. Private and Protected can not be accessed from Extension Class.
Added new field TstField in MainAccount Table using extension.
Would like to show newly added field on Trail balance Form/Report.
Added new field TstField in LedgerTrialBalanceTmp Table using extension.
/// <summary>
/// Extension Class
for LedgerTrialBalanceDP
/// </summary>[ExtensionOf(classStr(LedgerTrialBalanceDP))]
final class
HNWLedgerTrialBalanceDP_Extension
{
protected void new()
{
}
///
Updating new field in <c>LedgerTrialBalanceTmp</c> Table
///
</summary>
public void UpdateTstField()
{
MainAccount mainAccount;
DimensionAttributeValueCombination ledgerDimension;
LedgerTrialBalanceTmp ledgerTrialBalanceTmp;
ledgerTrialBalanceTmp = this.getLedgerTrialBalanceTmp();
update_recordset ledgerTrialBalanceTmp
settingTstField = mainAccount.TstField
join mainAccount
exists join ledgerDimension where
ledgerDimension.MainAccount == mainAccount.RecId &&
ledgerDimension.RecId == ledgerTrialBalanceTmp.LedgerDimension;
this.setTrialBalanceTmpTable(ledgerTrialBalanceTmp);
}
}
Create postEventHandler for processReport method in LedgerTrialBalanceDP Class
and call our newly created method in Extension Class of LedgerTrialBalanceDP
public class HNWLedgerTrailBalanceHandlersExt
{
[PostHandlerFor(classStr(LedgerTrialBalanceDP), methodStr(LedgerTrialBalanceDP, processReport))]and call our newly created method in Extension Class of LedgerTrialBalanceDP
public class HNWLedgerTrailBalanceHandlersExt
{
public static void
LedgerTrialBalanceDP_Post_processReport(XppPrePostArgs args)
{
LedgerTrialBalanceDP ledgerTrialBalanceDP
= args.getThis();ledgerTrialBalanceDP.UpdateTstField();
}
}
Thanks for sharing your valuable information and time. Please keep updating
ReplyDeleteMicrosoft Dynamics AX Online Training
This comment has been removed by the author.
ReplyDeleteThanks for sharing this wonderful content.its very useful to us.I gained many unknown information, the way you have clearly explained is really fantastic.
ReplyDeleteoracle training in chennai
oracle training institute in chennai
oracle training in bangalore
oracle training in hyderabad
oracle training
hadoop training in chennai
hadoop training in bangalore