how to create Purchase Invoice using import process

One header record and all the available rows will be invoice lines.

Comments

  • loggerlogger Member Posts: 126
  • But i didn't get the solution for it. only header information is moving not the Line information. I need both information should move in purchase invoice :neutral:
  • loggerlogger Member Posts: 126
    @ismailthesacrificer1@gmail.com,
    I suggest you have a mistake in logic in your code. You can post you code here and we will take a quick look on it.
    Let's go!
  • loggerlogger Member Posts: 126
    @ismailthesacrificer1@gmail.com,
    Sorry, but major part of you code looks like you just taken it from blender. :smile:
    And gInsertData function has obvious mistakes. E.dg you use RowNo as parameter but always read data from row no. 1.
    Let's go!
  • Can you evaporate it.. Please
  • Thanks @logger for your Support and respond I got the solution for this.
  • Hi @ logger but it should accept even the record already exists is there any method to not to get this error ws8v6op7tr20.png

  • hello @ logger
    I was waiting for your reply it will be helpful if you respond.
  • lubostlubost Member Posts: 623
    Notes to your code:
    - you use RowNo as parameter but always read data from row no. 1 as logger says
    - values in purchase line should be used from previously created header, not from columns
    - purchase line Document Type is missing
    - purchase line Line No. is missing
  • Thanks @ lubost

    Yes i added purchase line Document Type and Line No.
    Can you please evaporate it i didn't understand it, yes its read only one record
  • nizar_mneimnehnizar_mneimneh Member Posts: 3
    Document type and line.no. are not enough u have to choose the most important thing which is Document No., btw u can also use rapid services in nav2016 and choose the fields u want and whether to validate or not on each one, but the file u import should be excel
  • lubostlubost Member Posts: 623
    Your code can create header and one line. If your Excel has more lines linked to one document no., you have two possibilities:
    - divide headers data and lines data into two sheets/files and create loop for import headers and loop for import lines
    - you can (theoretically) import data your way, but you have to change code to IF gPurchaseHeaderRec.INSERT(TRUE) THEN ; to avoid attempt to insert the same document twice. Bad message is that this code doesn't differentiate between double inserting and other error in insert trigger.
  • lubostlubost Member Posts: 623
    ... and the best way is use Dataport/XMLPort.
  • TQ lubost and nizar_mneimneh for responding.
Sign In or Register to comment.