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

PayToCode not set in invoice

Hello,

I create an new invoice, which is based on an existing order.

I add the orderlines to the invoice by using some code like this:

oInvoices.Lines.BaseEntry = OrderDocEntry

oInvoices.Lines.BaseLine = OrderPositionLineNum

oInvoices.Lines.BaseType = 17

The ShipToCode and the Address2-Field was filled with the correct values, also the Address-Field (BillToAddress), but the PayToCode-Field is still empty.

Trying to set oInvoices.PayToCode to the corresponding value from the order did not work.

Do I make something wrong or is there a error in DI API?!

Thanks for your help!

Sebastian

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 06, 2009 at 09:53 PM

    Hi Sebastian,

    Which Version of Business One (including Patch Level) are you using?

    It works fine for me in Version 2007A PL45. There is a very similiar issue related to creating Sales Orders based on Quotations, which will be fixed in a future patch. If you have access to the SAP Notes, see 1290487.

    If it still happens for you in the latest patch available it does look like an application error to me and I would suggest to log a SAP message if you can.

    In general the workaround is to set the PayToCode in the Addon. Example:

    oInvoice.PayToCode = oOrder.PayToCode

    Hope that helps.

    Kind Regards,

    Friederike Mundt

    SAP Business One Forums Team

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Sebastian,

      I do not think the issue you are describing is the exact same as in the 1290487. In the Note the scenario is to copy a Sales Quotation to a Sales Order.

      I could not reproduce the same issue when copying a Sales Order to an Invoice. Therefore I believe certain settings in the Database are relevant to reproduce.

      As the scenario is slightly different the workaround described in the Note might work partly only for the scenario you described.

      I would suggest to report the issue in a SAP Support Call to follow up and ensure it will be fixed if it is required.

      Kind Regards,

      Friederike Mundt

      SAP Business One Forums Team

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.