creating sales invoice by import (skip the same invoice)

julkifli33julkifli33 Member Posts: 1,087
I have data like this
20000,A,INV1,70000,A,1,100,1/1/2010
20000,A,INV1,1000,AA,2,200,1/1/2010

and code like this
IF NOT TempSalesHeader.GET(TempSalesHeader."Document Type"::Invoice,DataItem[3]) THEN
  CreateHeader
ELSE BEGIN
  SalesHeader.GET(TempSalesHeader."Document Type",TempSalesHeader."No.");
END;
.
.
.
insertsalesline

this is create sales invoice , for sales header and sales line
in line 2, which is the same invoice (INV1), it should be go to SalesHeader.GET(TempSalesHeader."Document Type",TempSalesHeader."No.");
but why it always go to CreateHeader?
what wrong with my code?

Comments

  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    First of all I would check the value of DataItem[3].
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • AndwianAndwian Member Posts: 627
    Second I would check the value of TempSalesHeader.COUNT and browse through them.
    Regards,
    Andwian
Sign In or Register to comment.