Creating dataport without quantity

VesnaVesna Member Posts: 24
HEy again,
Now I am trying to create another dataport where in Purchase Line only Item, No. Description and Amount have to be specified.
I assign variable for Line Amount only and try to import the file.
When I do it I see the message :
"Quantity must not be 0 in Purchase Line Document Type='Invoice', Document No.........."

I don't have quantity column in my file, only amount.
Any ideas are highly welcome.
Thanks

Comments

  • SavatageSavatage Member Posts: 7,142
    how can you have an amount if you have no qty?

    are you trying to import G/L lines.

    If you need to create an invoice without using Qty then you would use the Purchase Journal not a PO.

    you can always add
    Onafterimportrecord() some code like

    Quantity := 1;

    if your file doesn't contain it.
  • VesnaVesna Member Posts: 24
    Thank you so much Savatage,
    My first experience with Purchase Line dataport was so successful that I thought I can do anything there.
  • DenSterDenSter Member Posts: 8,305
    You CAN do almost anything in code, but you must realize that there is an important distinction between what is technically possible, and what is possible from a business logic standpoint.

    You would not be able to manually enter such a line, so you should not develop anything that does it for you. A good starting point would be to open the Purchase Order and enter a line manually, while the debugger is on. Then you keep track of what happens behind the scenes, to determine which fields you need to validate and such. This is the basis of your dataport.

    Like Harry said, you have to have a quantity to have an amount.
Sign In or Register to comment.