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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

simple way of adding field in purchase invoice form and initialize it

(0) ShareShare
ReportReport
Posted on by

Hi All,

I have added a few fields in purchase line, I want to add the same fields to my purchase invoice form and being able to initialize it with purch line method.

On the face of it , it is as simple as that and ideally initializing field in initfromPurchline should be all required. But then this doesn't work. Even adding fields to purch parm line and adding the code to initialize in Vend document line map doesn't work.

(Someone has really worked hard to make it a mystery !)

So my question is , is there a simple way of achieving what I am trying to do or I need to tricks like writing code on form.

Please suggest

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    Hi Kumar,

    Did you use the debugger to find out if the methods mentioned by you are used or not?

    If it des, check if you did an incremental CIL compile..

  • Kumar Gaurav @ MS Profile Picture
    on at

    Hi Andre,

    I checked in debugger as well as cross reference and found that the methods are island.

  • Verified answer
    Denis Macchinetti Profile Picture
    16,444 on at

    Hi Kumar

    You have two possibiliy :

    1- Create the fields on VendInvoiceTrans table, modify the initFromPurchLine method of the same table and Compile incremental CIL

    This method is call by the Vend Invoice posting, from the PurchInvoiceJournalCreate class, createJournalLine method.

    2- Create display fields on VendInvoiceTrans table related the Purchline fields that you want to show in the VendInvoiceJournal form and add in the grid.

    Take care to handle the cache for performance issue.

    sinedax.blogspot.it/.../caching-display-method.html

  • Kumar Gaurav @ MS Profile Picture
    on at

    Hi Denis,

    Thanks for the response, as suggested I want to show those values on the table as well as let the end user override it if he wants, one way would be to do it through edit method but then it's really a work around. Given it's such a common user scenario, I am wondering why it is so hard to add one field on invoice screen, initialize it with PO value and pass it to journals.

    Cheers !

  • André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    Hi Kumar,

    By using the debugger you should be able to find the method used to initialize the Vendor invoice lines. Perhaps you can start with setting the breakpoint on the insert method of the table?

    I would not go for the display method option as it is somehow possible to clean up processed purchase orders. Then the data would be unavailable.

  • Kumar Gaurav @ MS Profile Picture
    on at

    Hi Andre,

    You are right about the Display method, but the debugger surprisingly doesn't hit the insert method or any of init methods. Thought it to be a CIL issue but despite having generate full CIL none of the method are getting propelled.

    Cheers..!

  • André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    Hi Kumar,

    When debugging check if the User option 'Execute business operations in CIL' is disabled in your settings. Open your User Options form. On tab Development you can find this option.

  • Verified answer
    Kumar Gaurav @ MS Profile Picture
    on at

    Tried all sorts of thing (Generate full CIL, ON/OFF CIL check box) and only solution (though not convincing) is create EDIT method to initialize from source and subsequently manage it at the target. Given it's PO lines with fewer records so I won't be overtly worried about performance for now. But would like to see a simpler solution for simple problem. Unless we are suggesting that edit or display method is only way to handle this.

  • AlokShrestha Profile Picture
    1,645 on at

    Hi Kumar,

                  Did you figure this out? Please let me know if you did other than edit method.

    Thanks

  • Community Member Profile Picture
    on at

    Add methods to initialize your fields from the VendDocumetnLineMap to the class VendDocumentLineType and call them in the \Classes\VendDocumentLineType\initFromPurchLine method.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Sukrut Parab Profile Picture

Sukrut Parab 2 Moderator

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans