Auto Populate Reason Codes in fixed asset journal Module

Hello!,

I am using Ax2012.

In the fixed asset module when I create Depreciation journal lines, Acquisition and Consumption depreciation using Proposals option located on the toolbar, I want the reason codes to be auto populated. I.E I want the Acquisition proposal to take its default reason code value which is “Acquisition”.

Please find the below image for more clarification.

I tried assigning the value in the initvalue method of LedgerJournalTrans datasource but it didnt work.Any help would be appreciated.

Thanks

I think ledgerJournalTrans is created here, \Classes\AssetJournal\populateLedgerJournalTrans
Try by having your code there.

Hello Kranthi!,

Can you please help me with the code.

Thanks

I also tried debugging the class is not hit on creating a journal line.

Thanks

Can you tell the steps that you followed?

Fixed Assets > Fixed assets in journal Menu > LedgerJournalTable form opened, I selected lines for a particular journal > LedgerJournalTransAsset form opened, I selected proposals in the tool bar and I chose Depreciation proposal a dialog box opened I chose the required fixed assets, date interval and clicked OK. Proposals were created with the reason code value blank.

Please see below image for clarification,

I can confirm that \Classes\AssetJournal\populateLedgerJournalTrans is where the LedgerJournalTrans is populated.
This class is not running on server. May be you have not enabled the server side debugging.
Where you have written the code in that method?

I am not sure where to write as the debugger didnt hit the class, I request you to suggest me where and what code to write populate the field.

You can write any where after ledgerJournalTrans.initValue(); call in populateLedgerJournalTrans method.

I tired this following code after ledgerJournalTrans.initValue(); but its not working. Is my code correct or I have to try alternatives?,

if(ledgerJournalTrans_Asset.TransType == AssetTransTypeJournal::Depreciation)
{
ledgerJournalTrans.ReasonRefRecID = AssetTransTypeJournal::Depreciation;
}

ledgerJournalTrans.ReasonRefRecID is a RecId(reference) and you are assigning a enum value to it.
Find the related ReasonTableRef table record id and do the assignment.
As you are using ledgerJournalTrans_Asset field value, you should write your code after the field values are updated (this also done in the same method).

I couldn’t understand what do u mean by write your code after the field values are updated can u please elaborate.

See where ledgerJournalTrans_Asset.TransType field is updated in populateLedgerJournalTrans method and right your code after that.

Thank you so much. I ll try the code and get back to you .