web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to add new custom fields in AP Invoice Journal

(0) ShareShare
ReportReport
Posted on by 1,813

Hello, We want to capture some additional info when adding invoices in AP->Journals->Invoices->Invoice journal. The additional info is Vehicle Number and Expense Type. If the invoice is related to vehicles, then data entry operator will select vehicle and expense type, otherwise no need to save this info with invoice. It could be multiple lines. 

I have two new tables VehicleTable (with VehID and VehName) and VehicleExpenseTable (VehExpId and ExpName). On Invoice journal form two dropdown lists for vehicle and expense type should appear. 

At the end we want to generate reports based on amount spent on Vehicles by Expense type. 

We have AX 2012 R3.

I need help in the following 

1. What AX tables to add new custom fields i.e.  VehID  and VehExpId and relations. i.e.      LedgerJournalTrans, VendInvoiceInfoTable, VendInvoiceJour or else. 

2. Where to display Vehicle and Expense type combo box i.e. line or new group.

3. What to do before and after Posting.

4. What classes and methods to write the code.

5. Any better suggestions to do this customization.

Thanks and Regards,

 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at
    RE: How to add new custom fields in AP Invoice Journal

    Hi Rana,

    doing customization is up to your requirements if needed you should do it, you need the customization(2 foreign key relationships in LedgerJournalTrans) in LedgerJournalTrans tables only, because after Posting invoice data will transfer to GeneralJournalEntry and GeneralJournalAccountEntry tables which you can get by voucher its unique.

  • Rana Anees Profile Picture
    1,813 on at
    RE: How to add new custom fields in AP Invoice Journal

    Thanks Ghiasuddin,

    Do I need to add two more FK in GeneralJournalEntry and GeneralJournalAccountEntry tables as well and where to write code to assign new values?  VendInvoiceInfoTable, VendInvoiceJour what are these tables for... Please explain. Thanks

  • Community Member Profile Picture
    on at
    RE: How to add new custom fields in AP Invoice Journal

    No need, for reporting purpose you need to get the values which you can get it by voucher.

  • Rana Anees Profile Picture
    1,813 on at
    RE: How to add new custom fields in AP Invoice Journal

    Hii,

    I have added two new fields to LedgerJournalTrans. These are working fine. I can save them with each line.

    veh.png

    Should I keep these two values in LedgerJournalTrans table or also need to add in GeneralJournalEntry and GeneralJournalAccountEntry.

    I have one more requirement. Sometimes we pay Vehicle Expense Invoices through Petty Cash Journal and I need to store Vehicle Number and Vehicle Expense Type on Petty Cash Transaction as well.

    Please guide how do I create report for Vehicle Number and Vehicle Expense Type.

    Thanks,

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    299,314 Super User 2025 Season 2 on at
    RE: How to add new custom fields in AP Invoice Journal

    Hi Rana,

    Why are you trying to solve this requirement with a customization? It is possible to setup two custom financial dimensions and use these. Then you can report on the dimensions also using e.g. Management reporter. The dimensions can be used system wide.

    If the vehicle table and expense type are having some more fields/functions you can also consider making these tables dimensionable. Then you can use them as entity backed dimensions like Vendors, Items, etc.

    Create a financial dimension [AX 2012]

    Microsoft Dynamics AX 2012 White Papers: Code Upgrade (choose the file Implementing_the_Account_and_Financial_Dimensions_Framework_AX2012.pdf)

  • Rana Anees Profile Picture
    1,813 on at
    RE: How to add new custom fields in AP Invoice Journal

    Thanks Andre,

    This is really a good idea to make Vehicles and Expense Types as entity backed dimensions instead of customization. But the document you referenced are kind of code upgrade, while in my installation our vendor already has implemented few dimensions like Departments and im unable to understand. Please guide how the new to AX could easily make this happen...with some good example for AX 2012 R3.

    Thanks,  

  • André Arnaud de Calavon Profile Picture
    299,314 Super User 2025 Season 2 on at
    RE: How to add new custom fields in AP Invoice Journal

    Hi Rana,

    I forgot to mention that this document contains a section how to enable custom tables as entity backed dimension. This is the most important part of the document for you now. The other parts can be ignored for this moment.

    Is this customer already live with the system? Then it will be still possible to add dimensions, but it needs to be planned in cooperation with the customer.

  • Rana Anees Profile Picture
    1,813 on at
    RE: How to add new custom fields in AP Invoice Journal

    Thanks Andre,

    Client don't want to implement it in Dimensions. He wants to select Vehicle and Vehicle Expense type on AP -> Invoice journal -> Lines. And a report showing Vehicles expense wise.

    What so far I have done, created two tables Vehicles and Expense Types and linked with LedgerJournalTrans table. On Invoice Journal lines I can select Vehicles and Expense Types  from Drop-down lists. Its saving and OK.

    vexp.PNG

    Please guide me, am I going correct way and what to do next. Should I keep it up to LedgerJournalTrans table. Looking for your professional response.

    Regards,

  • André Arnaud de Calavon Profile Picture
    299,314 Super User 2025 Season 2 on at
    RE: How to add new custom fields in AP Invoice Journal

    As the customer don't want to implement Dimensions for it he will probably regret it in future. But I might be wrong.

    In this case you also have to create these fields on the GeneralJournalAccountEntry table and ensure that the posting logic will also bring it to this table.

    The LedgerJournalTrans is a worksheet typed table which means it can be deleted after posting, so you need to move them to a transaction table like the GeneralJournalAccountEntry. Note that changing the posting logic is touching the heart of AX.

  • Rana Anees Profile Picture
    1,813 on at
    RE: How to add new custom fields in AP Invoice Journal

    I can save new custom values in LedgerJournalTrans and GeneralJournalAccountEntry tables. Now I want to make new report. I want to select records from LedgerJournalTrans (as you say enough for reporting purpose) according to new records only, not by voucher.

    Following fields required on Report...

    Vehicle ID | Expense ID | TransDate    |   Amount

    2031JAK      VEXP0002    02/08/2016     500.00

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

#2
Guy Terry Profile Picture

Guy Terry 2 Moderator

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans