In one of SSRS Report requirement, client wants to see Purchase order quantity, Invoice Quantity against items purchase requisition Quantity.
Instead of writing a query on ItemId and InventdimId, I found out of the box function In PurchReqLine table. This method return the reference of Purchline. With reference of Purchline, I can get Purchase order Number and get Item Invoiced quantity.
_purchLine = reqline.purchLine();
The relationship between Purchline and PurchReqline is RecId, Purchline contains the Reference RecId of PurchReqline.
if (this.PurchId && this.LineRefId)
select firstonly purchLine
where purchLine.PurchId == this.PurchId &&
purchLine.PurchReqLineRefId == this.LineRefId &&