Options

how to create Purchase Invoice using import process

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

Comments

  • Options
    loggerlogger Member Posts: 126
  • Options
    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:
  • Options
    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!
  • Options
    9csv2nc25rrc.png
    bwl6ey8qdgos.png
    w7g0vkft6s2g.png
    unsbyh4h5ftl.png


  • Options
    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!
  • Options
    Can you evaporate it.. Please
  • Options
    Thanks @logger for your Support and respond I got the solution for this.
  • Options
    Hi @ logger but it should accept even the record already exists is there any method to not to get this error ws8v6op7tr20.png

  • Options
    hello @ logger
    I was waiting for your reply it will be helpful if you respond.
  • Options
    lubostlubost Member Posts: 614
    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
  • Options
    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
  • Options
    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
  • Options
    lubostlubost Member Posts: 614
    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.
  • Options
    lubostlubost Member Posts: 614
    ... and the best way is use Dataport/XMLPort.
  • Options
    TQ lubost and nizar_mneimneh for responding.
Sign In or Register to comment.