report which will create 100 purchase orders, 100 sales orders for same vendor and same item for testing
i have taken two data items
purchase header
purchase line
i have written the code in onaftergetrecord()
IF "Purchase Header".FINDLAST THEN
FOR i :=1 TO 5 DO
BEGIN
"Purchase Line".INIT;
"Purchase Header"."Document Type" :="Purchase Header"."Document Type"::Invoice;
"Purchase Header"."No.":="Purchase Line"."No.";
"Purchase Header"."No.":='55555';
"Purchase Line".INSERT;
END
it was throwing an error
purchase line already exists identification fields and values
can any one suggest me some idea.regarding this
thank you
0
Comments
IF "Purchase Header".FINDLAST THEN
"Purchase Header".INIT;
"Purchase Header"."Document Type" :="Purchase Header"."Document Type"::Invoice;
"Purchase Header"."No.":='5899';
MESSAGE('%1',"Purchase Header"."No.");
"Purchase Header".INSERT
END
coming to this code it was trowing an error already exists
IF "Purchase Header".FINDLAST THEN
FOR i :=1 TO 5 DO
BEGIN
"Purchase Header".INIT;
"Purchase Header"."Document Type" :="Purchase Header"."Document Type"::Invoice;
"Purchase Header"."No.":='5899';
MESSAGE('%1',"Purchase Header"."No.");
"Purchase Header".INSERT
END
but how can i 100 lines with same item
can any one give me suggestion
i have taken two data items
purchase header,purchase line
code unit=noseriemanagement
record=purchase & payable setup
and i have return this code in onafter get record()
Pursetup.GET;
IF "Purchase Header".FINDLAST THEN
FOR i :=1 TO 5 DO
BEGIN
"Purchase Header".INIT;
pheader."No.":=nomgmt.GetNextNo(Pursetup."Order Nos.",0D,TRUE);
pheader."Buy-from Vendor No.":='1255';
pheader.INSERT;
END
thank you.....