I need help to get data from prodtable that are related to salesline. My task is to get all Prodid that are related to current salesid. Related field prodtable.inventrefid == salesline.salesid. But the values are a bit differend to join so I get no data. Inventrefid have eg. ZPR0000011 and sales id is ZS00000011.
salesline tablebuffer = this.cursor();
while select ProdId, CollectRefProdId from prodtable where prodtable.inventrefid == 'ZPR00000165'
The main problem I immediately see is:
inventRefIdwould be yourSalesId, which isZS00000011not yourProdId.An example of a more correct query is below. You can refine it by joining the two selects together so you get all related
ProdTablerecords to allSalesLinerecords for a givenSalesIdand you can also specify fields in the queries so that you are not returning the entire buffer.