You are not selecting SearchName and you are not saying for which prodId you need the search name.
select firstonly SearchName from stab
existsjoin prod
where prod.InventRefId == stab.SalesId
&& prod.ProdId == prodJournalRoute.ProdId; // prodJournalRoute is the data source name in the report
You should use the debugger to debug your code; discussion forums aren’t a replacement of debugger.
First check if your code returns the right value or not. If not, running the report is a waste of time; it can’t ever show anything if the method doesn’t provide any value.
If it does return the value, looking at this code is useless, because the problem is somewhere in how you display the value in the design.
By the way, please use Insert > Insert code in the rich formatting view to paste source code and throw away unrelated things such as the code you’ve commented out. Compare the readability with what you posted above:
For that reasoning we are using ProdTable in between.
You are using same ProdId in getSearchName method. That’s why i asked you to debug those methods as well.
If you have the correct value in prodJournalRoute_1.ProdId, then you should get the SearchName from salesTable.
Do you really have the related data in SalesTable? Is your production order created from the sales order?