I have the below code snippet but can't seem to get it to work, gives me an error saying: "Purch. Rcpt. Hdr. No. '' does not exist."
It in the OnAfterGetRecord() trigger on the report.
PurchRcptHdr.GET;
IF ("Document No." = PurchRcptHdr."No.") THEN BEGIN
OrderNo := PurchRcptHdr."Order No.";
VendorOrderNo := PurchRcptHdr."Vendor Order No.";
ShipmentNo := PurchRcptHdr."Vendor Shipment No.";
END ELSE BEGIN
CurrReport.SKIP;
END
This is what i have now, is there any preformance issues i should be concerned with here as in am i calling stuff i don't need?
IF NOT PurchRcptHdr.GET("Document No.") THEN
PurchRcptHdr.INIT;
IF ("Document No." = PurchRcptHdr."No.") THEN BEGIN
OrderNo := PurchRcptHdr."Order No.";
VendorOrderNo := PurchRcptHdr."Vendor Order No.";
ShipmentNo := PurchRcptHdr."Vendor Shipment No.";
END ELSE BEGIN
CurrReport.SKIP;
END
You're thinking too complicated. When you GET the receipt with the value of "Document No.", the value is always the same, you don't need to figure out if it is the same. I'd rewire your code something like this:
IF PurchRcptHdr.GET("Document No.") THEN BEGIN
OrderNo := PurchRcptHdr."Order No.";
VendorOrderNo := PurchRcptHdr."Vendor Order No.";
ShipmentNo := PurchRcptHdr."Vendor Shipment No.";
END ELSE BEGIN
CurrReport.SKIP;
END;
If this is all the code in your OnAfterGetRecord, you wouldn't even have to do CurrReport.SKIP because that's the end anyway.
Answers
(Sr. Tech. Consultant)
Dataman Computer Systems (P) Ltd.
web :www.datamannet.com
mail :nrapendra@datamannet.com
So with wich value you wan't to get the Purch. Rcpt. Header :?:
PurchRcptHdr.GET; <- This gets an REc with an empty No.
you need following
Regards
RIS Plus, LLC