Skip to Content
author's profile photo Former Member
Former Member

Updating Invoice header and item Table

hello pals,

Please can someone show me how to update OINV and INV1 respectively through code.am developing an Add-on which will update this two tables and the OINV table get updated correctly but the INV1 tables does not but rather insert new records.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Feb 05, 2014 at 10:13 AM

    Hi Annie,

    To update a specific line of document, you need to query the document first and look for the VisOrder field.

    The use this method to call the line you need to update, passing the VisOrder you have got from the query.

    oDocs.Lines.SetCurrentLine(iVisOrder);

    ..Update all your data here.

    Then execute the update function,

    oDocs.Update();

    Regards

    Edy

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 06, 2014 at 12:09 PM

    Hi Annie,

    SInce you are not familiar with sdk yet,

    i suggest you make yourself comfortable first by removing the loop and try to hardcode everything.

    this code is to update the first line

    oInvoice.Lines.SetCurrentLine(0)

    oInvoice.Lines.ItemCode = 'AnyItemCodeHere'

    oInvoice.Update

    check your invoice....

    if your invoice has 3 lines. Use this to update the last line.

    oInvoice.Lines.SetCurrentLine(2)

    oInvoice.Lines.ItemCode = 'AnyItemCodeHere'

    oInvoice.Update

    check your invoice....


    Use this to add a new line

    oInvoice.Lines.Add

    oInvoice.Lines.ItemCode = 'AnyItemCodeHere'

    oInvoice.Lines.Quantity =1

    oInvoice.Update

    check your invoice....



    Regards,

    edy

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.