Hi everyone!
I'm not "the" Navision expert so please be nice to me
In my company I have to create or modify reports in Navision 2009 from time to time. I had a training on how to create reports and learned very much from existing reports, books and the internet.
Till now every report worked fine, but I'm always having problems when trying to query a record which doesn't exist.
For example in my current report I want to look up if a "Sales"-Entry exists in the "Item Ledger Entry" table; if it does then I want it to get exported, if it doesn't of course there's nothing to export.
So in C/AL I'm filtering on the "Serial No." and the ""Entry Type"::Sale"; then with "FIND" I want to get the record. Now if the record exists then there's no problem, but if it doesn't I'm getting the error "There is no Item Ledgery Entry within the filter".
I have already found out that I'll have to handle the return value from "FIND" so I included an "IF"-condition for true and false return values but I'm still getting this error message.
So now my question: How can I omit the false return message?
Best regards,
Max
Comments
IF FIND...
To omit the error message.
For debugging I applied a filter on my report so that only one serial number is processed and suddenly the report ran without any error. So I've looked closer at my code and found the cause; it was the "setrange"-filter which I applied in order to find the "sale"-entry. I forgot to reset it so at the next data item it was still applied and an other "FIND"(without if) failed.
So I just had to reset the filter at the end of my code and the report worked as desired.
Thank you very much for your help!