Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

I get an error when I use table relation with filters

Posted on by 184

I get this error when I try to use table relation with filters 
Microsoft.Dynamics.Nav.Types.DBLazy  it is not the error itself but it is being inserted in the field instead of the value 
Can any one help me?

  • Suggested answer
    Hallister Profile Picture
    Hallister 2 on at
    I get an error when I use table relation with filters
    The error is still present in BC24.5.
     
    Steps for reproducing:
    Create a table field with a table relation to another table and to a field outside the primary key. The TableRelation must be set to false.
    Insert the field into a page object.
     
    Example:
    field(10; ‘Additional Field’; Code[10])
    {
        Caption = ‘Additional Field’;
        TableRelation = ‘Location’. ‘Additional Field’;
        ValidateTableRelation = false;
     }
     
    If you now try to make a selection via drilldown, you receive the error ‘Microsoft.Dynamics.Nav.Types.DBLazy’
    If you use the ‘Show full List’ function for selection, the expected value will be applied.
     
    Solution:
    The error can be avoided if the required field is added to the drilldown page of the corresponding table. The field does not even have to be visible.
     
    Example:
    pageextension 50000 ‘Location List’ extends ‘Location List’
    {
        layout
        {
            addlast(Control1)
            {
    
                field(‘Additional Identifier’; Rec. ‘Additional Identifier’)
                {
                    ApplicationArea = All;
                    Visble = false;
                }
            }
        }
    }
    I hope I was able to help you with this.
    Happy Coding
  • I get an error when I use table relation with filters
    What helped for me is to add this field to the page and then the error didn't happen anymore, could find other solution for this
  • Muaaz Deyab Profile Picture
    Muaaz Deyab 184 on at
    RE: I get an error when I use table relation with filters

    I solved this by using OnLookup trigger, still could not figure out what was the problem

    but here is the Code

    field(5; "Requester"; code[20])

           {

               DataClassification = ToBeClassified;

               TableRelation = Requester.OnBehalf where("User Name" = field(Preparer), Status = const(Approved));

               ValidateTableRelation = false;

    }

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: I get an error when I use table relation with filters

    Maybe you can try to share your code, then it is easier to assist you in cases like this.

    Or at least elaborate a little more about what you are trying to do and from where?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans