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)

VendInvoiceInfoline.insert() not fired

(0) ShareShare
ReportReport
Posted on by

Hi

I have an issue in calling VendInvoiceInfoLine table's insert() method.

I have code to fill misc charges based on the recid of VendInvoiceInfoLine record.

Since its not firing the insert method the misc charges table is also not filled, what would be the best place otherwise to make sure the code is triggered.

Thanks in advance

AK

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: VendInvoiceInfoline.insert() not fired

    Did you find an explanation for why insert isn't fired? And what is fired instead to add records to the VendInvoiceInfoLine

  • Community Member Profile Picture
    on at
    RE: VendInvoiceInfoline.insert() not fired

    Did you figured out why insert() method is not triggering ?

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: VendInvoiceInfoline.insert() not fired

    The insert could be done with doInsert() or RecordInsertList. To still find where the insert is done you can override the aosValidateInsert() method of the table and set a breakpoint in it.

  • Mariano Gracia Profile Picture
    on at
    RE: VendInvoiceInfoline.insert() not fired

    You should be carefull with this tables, each time you edit a purchase invoice in the VendInvoiceInfoListPage a new form is opened (VendEditInvoice) and the header and lines are copied, so in fact, you're editing a copy of the original VendInvoiceHeader and Lines, when you close the form, if modifications are accepted, the original lines are deleted and the new ones are saved from the edit form, so the RecId field is changing each time you edit and accept modifications (is one of the worst forms I have ever seen in AX as this causes a lot of deletes and inserts).

    I suggest you to use other fields, TableRefId - ParmId - OrigPurchId - LineNum instead of RecId, those fields do not changes except ParmId, this field is empty if the invoice is not being edited, if you are editing the invoice, ParmId is informed.

    You can also look at the copyFroomVendInvoiceInfoLine method in the VendInvoiceInfoLine table, this method is called each time you are editing an invoice. 

    The method you're looking for is insertParmLine from the PurchFormLetterParmDataInvoice

  • Anshuman Gupta Profile Picture
    on at
    RE: VendInvoiceInfoline.insert() not fired

    Are you writing custom code and the insert on VendInvoiceInfoLine isn't getting triggered? Or is it product code that doesn't call the VendInvoiceInfoLine.insert()? If it's product code, it might have been calling either doinsert() on VIIL or it might be using setbased operations to insert data in VendInvoiceInfoLine table.

  • Anshuman Gupta Profile Picture
    on at
    RE: VendInvoiceInfoline.insert() not fired

    Hello Mariano, I just wanted you to inform that the entire copying logic from one record to another in the VendEditInvoice form which was previously called as "Active-Saved" pattern has now been removed and we behave exactly as other forms do. We still use the parmId to populate the session Id but when you open the Invoice from ListPage you just have one record in the database. This change has been backported to AX6.3 and AX6.2 releases too and you can look for the hotfixes. :)

    -Anshuman

  • Mariano Gracia Profile Picture
    on at
    RE: VendInvoiceInfoline.insert() not fired

    Hello Anshuman, I'm really interested about this hotfix you're talking about, one of my customers is a purchase center and they use the vendeditinvoice form a lot, each time they edit an invoice a new record is created, so as I understant you this "active-saved" pattern has been removed, they have 2012 R2CU7 with KB3051445 installed, I have been looking in the lifecicle services, but I haven't found anything, can you provide me the kb number please? I would very much appreciate it.

  • Mariano Gracia Profile Picture
    on at
    RE: VendInvoiceInfoline.insert() not fired

    I think I found it, KB3058304, I will test it immediately

  • Anshuman Gupta Profile Picture
    on at
    RE: VendInvoiceInfoline.insert() not fired

    I am glad you found the hotfix. Just ensure that you test appropriately before taking the hotfix. This was a big change.

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

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 3

#3
Scott_itD Profile Picture

Scott_itD 2 Community Manager

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans