web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Run Report with predefined filters

(0) ShareShare
ReportReport
Posted on by 354

Hi, 

I want to run the inventory valuation report with predefined filters, i have created a table to store the filters of the report then created list page and kept one action button, which calls report with predefined report filters.


Item.SETRANGE("Item Category Code","Item Category Code");
Item.SETRANGE("Inventory Posting Group","Inventory Posting Group");
Item.SETRANGE("Replenishment System","Replenishment System");
REPORT.RUN(10139,TRUE,FALSE,Item);

The problem is Item Category code filter has more than 10 chars, like this

<>A1&<>A2&<>A3&<>A4&<>MA&<>MB&<>MF&<>EA&<>EE&<>EG&<>EH&<>EI&<>EK&<>EL&<>EU&<>EV&<>RP&<>CN

when i call the report i stuck with this error message 

Microsoft Dynamics NAV
---------------------------

The length of the string is 89, but it must be less than or equal to 10 characters. Value: <>A1&<>A2&<>A3&<>A4&<>MA&<>MB&<>MF&<>EA&<>EE&<>EG&<>EH&<>EI&<>EK&<>EL&<>EU&<>EV&<>RP&<>CN
---------------------------
OK
---------------------------

Could anyone know how to handle this.

Thanks,

Shyam Kumar N

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    RockwithNav Profile Picture
    9,113 Super User 2026 Season 1 on at

    Hey Shyam,

    Cause of this Error message is very simple and clear as for Item Category Code the character defined is of Code 10 only(Item Table) and here its exceeding to even more then 80 that's why NAV is displaying this Error.  

  • Shyamraoo Profile Picture
    354 on at

    Hi Rock,

    i can able to give this filter in Request PAge of the report, but how to handle this during dynamically calling the report in C/AL code.

    I understood that issue.  give some suggestions to handle this.

    Thanks

    Shyam Kumar N

  • Suggested answer
    Alexander Ermakov Profile Picture
    28,096 on at

    I remember there has been error in 2013 that has been hotfixed...

    dynamicsuser.net/.../65662

    Would this be a workaround for you?

    www.olofsimren.com/.../

  • Verified answer
    Suresh Kulla Profile Picture
    50,278 Super User 2026 Season 1 on at

    Instead of SETRANGE use SETFILTER

    Replace it with this

    Item.SETFILTER("Item Category Code","Item Category Code");

  • Verified answer
    4BzSoftware Profile Picture
    6,073 on at

    Hi Shyamraoo,

    Change SETRANGE to SETFILTER:

    Item.SETFILTER("Item Category Code", '<>A1&<>A2&<>A3&<>A4&<>MA&<>MB&<>MF&<>EA&<>EE&<>EG&<>EH&<>EI&<>EK&<>EL&<>EU&<>EV&<>RP&<>CN');

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans