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)

fileter against customer

(0) ShareShare
ReportReport
Posted on by

hi friends,

i want to set filter against customer no and cost center code using CAL code and want to get the customer based on  cost center code in nav 2016

table-filters.png

thanks & regards,

ashwni

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mohana Yadav Profile Picture
    61,214 Super User 2026 Season 1 on at

    do you want to show customers based on cost center field in page you mentioned. I cant see cost center field.

    you need to write code in OnLookup trigger of Customer No field

  • Community Member Profile Picture
    on at

    Hi mohana

    thank you for reply

    i have used this code on account no field

    IF "Account Type" = "Gen. Journal Line"."Account Type"::Customer THEN BEGIN

     Customer.SETRANGE("No.","Global Dimension 1 Code"); but i did get pls give any solution.

    thank you

  • Suggested answer
    Mohana Yadav Profile Picture
    61,214 Super User 2026 Season 1 on at

    Customer.SETRANGE("No.","Global Dimension 1 Code");

    what value do you have in "Global Dimension 1 Code" of selected line? is it customer No?

  • Community Member Profile Picture
    on at

    Hi mohana

    Global dimension code having lot of cities like (Chennai Bangalore and Madurai) if i choose Chennai i need to show Chennai customers this my requirement mam i dont know how put filters against customer.

    thank you

  • Verified answer
    Mohana Yadav Profile Picture
    61,214 Super User 2026 Season 1 on at

    Customer.SETRANGE("No.","Global Dimension 1 Code");

    You are setting filter on Customer No with city code

    like you are searching for Chennai in Customer no field.

    you need to set filter on City name of customer table like

    Customer.SETRANGE(City,"Global Dimension 1 Code");

    you need to run page with above filters like

    CustPage.SETTABLEVIEW(Customer);

    CustPage.SETRECORD(Customer);

    CustPage.LOOKUPMODE(TRUE);

    IF CustPage.RUNMODAL = ACTION::LookupOK THEN BEGIN

      VALIDATE("Account No.",Customer."No.");

    END;

    I didnt test code

  • Community Member Profile Picture
    on at

    Hi Mohana

    thank you so much for you reply your very great. i got a solution

    once again thank you

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