Hello!,
I am using ax 2012.
On creating new fixed asset journal lines by clicking new or even by using proposals in the toolbar (i.e Acquisition Proposal, Depreciation Proposal etc), I want the reason codes to be auto populated based on the Journal Name.
I have created a new Field in the LedgerJournalSetup form(i.e Ledger JournalName Datasource) which contains the Default Reason Code for the particular journal Name. Based on that field I want the Fixed asset journal line to be updated.
Please see the following Images for more clarification,



I wrote the following code in classes/ledgerJournalEngine/initValue as well as classes/ledgerJournalEngine/ledgerJournalTableUpdateTotals for proposal purpose,
while select ledgerJournalName
where ledgerJournalName.JournalName ==ledgerJournalTable.JournalName &&
ledgerJournalTransOrig.JournalNum == ledgerJournalTable.JournalNum
{
ledgerJournalTransOrig.ReasonRefRecID = ledgerJournalName.ReasonRefRecID;
reasonCode = ReasonTableRef::find(ledgerJournalTransOrig.ReasonRefRecID).Reason;
ledgerJournalTransOrig.editReasonCode(false,reasonCode);
}
But its not working. The recID is kept varying in the ReasonTableRef datasource. Please suggest alternate solutuions.
Thanks.