Insert Purch Line Programmatically

tompynationtompynation Member Posts: 398
When i execute the following, shouldnt this line then get's a "Line No." automatically?
Or do we have to calculate the Line No by ourself?

lv_PurchLine.RESET;
lv_PurchLine.INIT;
lv_PurchLine.VALIDATE("Document Type","Document Type"::Order);
lv_PurchLine.VALIDATE("Document No.",lv_PurchHeader."No.");
lv_PurchLine.VALIDATE(Type,lv_PurchLine.Type::"Charge (Item)");
lv_PurchLine.VALIDATE("No.",TRANSPORT);
lv_PurchLine.Quantity := 1;
lv_PurchLine.INSERT(TRUE);
COMMIT;

Answers

  • MBergerMBerger Member Posts: 413
    In the purchase order subforms, "Line no." gets a value because the "autosplitkey" property of the forms is set to true, but in this case you'll have to do it yourself.
Sign In or Register to comment.