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)

Adding a custom field to VendTrans through Post on Pending Invoices

(0) ShareShare
ReportReport
Posted on by 50

Hi, 

I have added a custom date field to the Vendor Invoice which is located on the VendInvoiceInfoTable and I need it to show on VendTrans or VendTransOpen table once the vendor invoice has been posted. Does anyone know how to do this? I was thinking of using a data method or adding it to a map? TIA

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mea_ Profile Picture
    60,284 on at
    RE: Adding a custom field to VendTrans through Post on Pending Invoices

    If you want to add new field to VendTrans  and pass a vale from VendInvoiceInfoTable  during posting you need to add your code into postCustVend() method of PurchInvoiceJournalPost and initCustVendTrans() of VendVoucher class.

  • chicagoax Profile Picture
    50 on at
    RE: Adding a custom field to VendTrans through Post on Pending Invoices

    hey thanks. could you expand a bit further? i am not too familiar with either class. I see the VendInvoiceInfoLine on postCustVend. Do I copy it straight to VendTrans or VendTransOpen? Why do you we need to modify the Vendvoucher class then? thanks again!

  • Mea_ Profile Picture
    60,284 on at
    RE: Adding a custom field to VendTrans through Post on Pending Invoices

    If you check post() method of CustVendVoucher class you will see that all values from custVendTrans get copied to local variables after that in initCustVendTrans() method custVendTrans get cleared and all values are copied back from local variables.

    So you can either create new parm* method on  VendVoucher class to pass new field during postCustVend() and use it in initCustVendTrans() or repeat  logic with saving value from custVendTrans  to local variable before clear.

  • chicagoax Profile Picture
    50 on at
    RE: Adding a custom field to VendTrans through Post on Pending Invoices

    Thanks again. That made sense for the most part. Does it mean I also need to add the new field to CustVendTrans table? How will that get it's value? Also in the initCustVendTrans method, the first thing it does is clear. So in the post method, do I need to save it to local variable or does it happen on it own and I just need to copy it back? Thanks again!

  • Mea_ Profile Picture
    60,284 on at
    RE: Adding a custom field to VendTrans through Post on Pending Invoices

    CustVendTrans is not a table, it's a map and yes, you need to add new filed to the map as well. AX assigns vendTrans to CustVendTrans that's how it is getting a value. Before it will clear it you need to save it to local variable in a post() method as I mentioned before.

  • chicagoax Profile Picture
    50 on at
    RE: Adding a custom field to VendTrans through Post on Pending Invoices

    ok got the map part figured out. also this article helped - vgrandhi.wordpress.com/.../post-a-custom-field-to-vendtranscusttrans-through-journal

    last question - do I modify the the CustVendVoucher or VendVoucher for the initCustVendTrans part? much appreciated

  • Mea_ Profile Picture
    60,284 on at
    RE: Adding a custom field to VendTrans through Post on Pending Invoices

    CustVendVoucher holds logic that is applicable to both customer and vendor posting, VendVoucher  only vendor specific. If you not going to do similar change for Sales invoice you can leave it in VendVoucher.

  • chicagoax Profile Picture
    50 on at
    RE: Adding a custom field to VendTrans through Post on Pending Invoices

    Hey ievegen,

    Sorry for the late reply. Just got around to testing this and it's not working. Can you tell me what the code for the post() method on vendvoucher will look like if I am using the new parm route? thanks

  • Mea_ Profile Picture
    60,284 on at
    RE: Adding a custom field to VendTrans through Post on Pending Invoices

    Hi chicagoax,

    Let's do it another way, tell us what changes do you have and we will try to say what is wrong.

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 3

#3
Willem van Duren Profile Picture

Willem van Duren 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans