Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

How to get Main account type of Main Account in x++

(0) ShareShare
ReportReport
Posted on by 1,811

Hii,

I am developing RDP report from LedgerJournalTrans table. The requirement is to select transactions of Main account type Profit and Loss  and other report for Balance Sheet accounts from LedgerJournalTrans table with some other criteria. 

How to know from (General journal -> Lines)  LedgerJournalTrans.LedgerDimension the Main Account is of type Profit and Loss or Balance Sheet in processReport method. 

Please some code examples. 

Thanks,

*This post is locked for comments

  • Ludwig Reinhard Profile Picture
    Ludwig Reinhard Microsoft Employee on at
    RE: How to get Main account type of Main Account in x++

    Hi Anees,

    This requirement cannot be fulfilled with reason codes especially that you can chose only one.

    Also the bank local transfer report is not a standard report, so I believe that you might be better off with the solution that you have chosen for the additional new checkboxes.

    Best regards,

    Ludwig

  • Rana Anees Profile Picture
    Rana Anees 1,811 on at
    RE: How to get Main account type of Main Account in x++

    Hii Ludwig Reinhard,

    About the reason codes, my requirement is we have a report at

    AP -> Payment Journal -> a journal -> Lines -> Print -> Bank Local Transfer Report .

    This is bank draft request form from a bank where we print info from our ERP.

    Our new requirement is to add two new fields (Check Boxes) Transfer and Bank Draft on Payment Journal lines form. The data entry operator will select Transfer and Bank Draft check boxes for a required transaction.

    If Transfer or Bank Draft or both are selected,  then should be printed on Bank Local Transfer Report.

    This report is based on Report Data Provider (RDP).


    bnk.PNG

    I think we can select only one reason code for one line, but we need two. 

    Sir, do you think Reason Codes is the solution for this requirement. 

    Regards,

    Anees

  • Ludwig Reinhard Profile Picture
    Ludwig Reinhard Microsoft Employee on at
    RE: How to get Main account type of Main Account in x++

    Hi Anees,

    You can find some Information about reason codes on the following site:

    https://technet.microsoft.com/en-us/library/gg242861.aspx

    Once you specify them in a transaction (e.g. Journal) you can filter and report - that is print - them in Management Reporter by making use of row modifiers.

    Example:

    4555.rc.png

    Reason codes are tracked similar to ledger accounts but users have a higher degree of freedom how, when and where to use them.

    Hope this helps.

    Best regards,

    Ludwig

  • Rana Anees Profile Picture
    Rana Anees 1,811 on at
    RE: How to get Main account type of Main Account in x++

    Hii Ludwig Reinhard,

    I have one more request from finance to add two more customized fields on general journals and payment journal forms. I will be very happy to understand and use reason codes.

    Could you please explain more about reason codes, how and where to use on forms and MR.

    Best Regards,

    Anees

  • Ludwig Reinhard Profile Picture
    Ludwig Reinhard Microsoft Employee on at
    RE: How to get Main account type of Main Account in x++

    Hi Rana Anees,

    Is it still an option for you to use reason codes instead of those added field? They are actually made for this purpose and can be analyzed in Management Reporter out of the box.

    If it is already too late, please have a look at the answer of ievgen.

    All the best,

    Ludwig

  • Verified answer
    Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: How to get Main account type of Main Account in x++

    Hi Rana Anees,

    Please refer to this thread community.dynamics.com/.../152606 discussing how to get main account from ledger dimensions. Having main account you can filter records by type easily.

  • Rana Anees Profile Picture
    Rana Anees 1,811 on at
    RE: How to get Main account type of Main Account in x++

    Hii Ludwig Reinhard,

    You are right, actually we have two new customized fields in LedgerJournalTrans table for vehicle expenses and for reporting purpose only. When we create general journal or payment journal, we select and save those fields based on some scenarios.

    I have a report that selects and shows required information and its perfect for our finance dept. But sometimes, our data entry operator mistakenly, selects and saves these new fields with balance sheet accounts while its only for profit and loss accounts.

    That's why I need some way to select only Profit and Loss accounts from my RDP class.

    Best Regards,

    Anees    

  • Ludwig Reinhard Profile Picture
    Ludwig Reinhard Microsoft Employee on at
    RE: How to get Main account type of Main Account in x++

    Hi Rana Anees,

    Why you want to develop a report for this purpose?

    Aren't  the standard reports and Management Reporter already sufficient?

    Best regards,

    Ludwig

  • Rana Anees Profile Picture
    Rana Anees 1,811 on at
    RE: How to get Main account type of Main Account in x++

    help please..

  • Rana Anees Profile Picture
    Rana Anees 1,811 on at
    RE: How to get Main account type of Main Account in x++

    In the following while loop where i need to select Main account type

    while select ledgerJournalTrans where ledgerJournalTrans.Voucher==voucherNum

    {

    }

    any solution please...

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,431 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,503 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans