We use the emptyBarcode field as a variable to store the Barcode value we find.
Once we populate the emptyBarcode in the CAL code, the value is displayed on the page in the emptyBarcode field
//-------------------------------------------------------------------
OnAfterGetRecord()
BarcodeRec.SETCURRENTKEY("BarcodeItem No.");
BarcodesRec.SETRANGE("BarcodeItem No.","Item No.");
BarcodesRec.SETRANGE("Show for Item",TRUE);
IF BarcodesRec.FIND('-') THEN
emptyBarcode := BarcodesRec."Barcode No."
ELSE BEGIN
BarcodesRec.SETRANGE("Show for Item");
IF BarcodesRec.FIND('-') THEN
emptyBarcode := BarcodesRec."Barcode No."
ELSE
emptyBarcode := '';
END;
//------------------------------------------------------------------------
Sample of how to cycle through records and get a sum
//-------------------------------------------------------------
SL.SETRANGE("Document No.","No.");
SL.SETRANGE("Document Type","Document Type");
IF SL.FIND('-') THEN
REPEAT
Docamt:= Docamt + SL.Amount
UNTIL SL.NEXT <= 0;
SL.Amount = Docamt;
SL.MODIFY;
//----------------------------------------------------------------
CAL Globals:- BarcodesRec
- Datatype: Record
- Subtype (Table): Barcodes
No comments:
Post a Comment