Hi all,
Previous consultant has added bar code no in transfer line table and written code to get details of item from barcode.
It is working perfectly but when I added code i’m getting error "transfer line doesn’t exist"while opening form if there is no lines for that order
below is the code. Is there any problem with code. Any clarifications let me know
IF BarcodesRec.GET(Barcode) THEN
BEGIN
VALIDATE(“Item No.”,BarcodesRec.“Item No.”);
Barcode := BarcodesRec.“Barcode No.”;
“Barcode Price”:= BarcodesRec.“Barcode Price”;
“Item No.”:= BarcodesRec.“Item No.”;
VALIDATE(Quantity,1);
“Total Qty”:=1;
“Margin(%)”:=BarcodesRec.“Margin %”;
“Margin Amount”:=BarcodesRec.“Margin Amount”;
PurchRcptLine.SETRANGE(PurchRcptLine.“Document No.”,BarcodesRec.“Purch Recpt doc No.”);
IF PurchRcptLine.FINDFIRST THEN
“Transfer Price” := PurchRcptLine.“Direct Unit Cost”;
“Vendor No.”:=PurchRcptLine.“Buy-from Vendor No.”;
Vendor.GET(PurchRcptLine.“Buy-from Vendor No.”);
“Vendor Name”:=Vendor.Name;
END;
//ADDED CODE FROM HERE
//unique barcode in transfer order
transferline.RESET;
transferline.SETRANGE(“Document No.”,“Document No.”);
transferline.SETRANGE(transferline.“Item No.”,“Item No.”);
IF NOT transferline.ISEMPTY THEN BEGIN
BEEP(300,400);
ERROR(’’);
END;
//taking picture
CLEAR(TransHeader);
IF TransHeader.GET(“Document No.”) THEN;
CLEAR(Item);
Item.GET(“Item No.”);
IF TransHeader.“Picture in T.O” THEN BEGIN
SHELL(‘C:\Users\Subhan\Desktop\New folder\Picture all\calc.bat’);
SLEEP(5000);
Picture.IMPORT(‘E:\Databases\Prasidi silks\image.bmp’);
END
ELSE
IF Item.“Picture item” AND TransHeader.“Default Picture” THEN BEGIN
SHELL(‘C:\Users\Subhan\Desktop\New folder\Picture all\calc.bat’);
SLEEP(5000);
Picture.IMPORT(‘E:\Databases\Prasidi silks\image.bmp’);
END;