Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

KeyNotFoundException

(0) ShareShare
ReportReport
Posted on by 985

Hi,

My Nav 2013 crashes when I try to preview a report, I debugged and got "KeyNotFoundException" as below:

System.Collections.Generic.KeyNotFoundException was unhandled

HResult=-2146232969
  Message=The given key was not present in the dictionary.
  Source=mscorlib

StackTrace:

--- all the inner exceptions come in here---

 InnerException:

Please I need help on this.

Thanks.

*This post is locked for comments

  • Toffsam Profile Picture
    Toffsam 985 on at
    RE: KeyNotFoundException

    Yes I also gave permissions to all the objects used in the code. All the record objects in the global variables.

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 44,656 on at
    RE: KeyNotFoundException

    It is just not the tables used in the report but they also need permissions of other tables/objects which are not listed as dataitems but are modified or used in the code.

  • Toffsam Profile Picture
    Toffsam 985 on at
    RE: KeyNotFoundException

    Thanks Suresh. He has permissions to all the tables in the report.  Clearly it is the permission on the role that is causing the issue, but I do not know what permission it is because it is not stating the required permission.  It works when I assign super role to the user.  Any user assigned to this role encounters the issue.

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 44,656 on at
    RE: KeyNotFoundException

    It looks like than the user does not have permission to the underlying tables which are used in the report. Try giving him permissions to the tables used in the report to his previous ROLE.

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 44,656 on at
    RE: KeyNotFoundException

    If you are experiencing this issue only with one user then it must be a permission or metadata issue.

    Please delete again metadata for that report and the user from object metadata, user metadata, page data personalization and if you don't have many customzation delete it from profile metadata and recompile report.

    If the above does not work try giving user SUPER permissions.

  • Toffsam Profile Picture
    Toffsam 985 on at
    RE: KeyNotFoundException

    It worked when I made the user a super user

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: KeyNotFoundException

    Could you make the user a super user and try the report? Just to make sure it has nothing to do with rights ?

    Maybe the report is updating something, or the report is inserting in a temp table ?

  • Toffsam Profile Picture
    Toffsam 985 on at
    RE: KeyNotFoundException

    Hi Suresh,

    I've done as you said now but am having same issue. I checked all the keys on the DataItems exists, I deleted the metadata from object metadata and user metadata and recompiled the report.

  • Toffsam Profile Picture
    Toffsam 985 on at
    RE: KeyNotFoundException

    I noticed only with this report

    and only with this user. but the user has all rights on the report.

    It happens both when previewing and printing.

  • Toffsam Profile Picture
    Toffsam 985 on at
    RE: KeyNotFoundException

    Hi Suresh,

    The report no. is 50000; a customized report.  and the user is given execute rights on the report.  Another user is able to preview.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,375 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans