Reporting: There is no * within the filter

regnorregnor Member Posts: 4
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

  • ftorneroftornero Member Posts: 524
    You can use

    IF FIND...

    To omit the error message.
  • regnorregnor Member Posts: 4
    "IF FIND" doesn't work. I'm still getting the error message.
    IF templedge.FIND THEN BEGIN
    END;
    
  • vaprogvaprog Member Posts: 1,141
    regnor wrote:
    "IF FIND" doesn't work. I'm still getting the error message.
    IF templedge.FIND THEN BEGIN
    END;
    
    • You are likely not getting the error message from that statement.
    • Can you carry on the same whether your FIND statement succeeded or failed?
    • Did you really intend to do a FIND('=') ('=' is the default if nothing is specified explicitly)?
  • KishormKishorm Member Posts: 921
    Run with the debugger active, It must be another FIND that you have (without an IF) that is causing the error.
  • regnorregnor Member Posts: 4
    Shame on me...you were right.
    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!
Sign In or Register to comment.