Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

fileter against customer

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: fileter against customer

    Hi Mohana

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

    once again thank you

  • Verified answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,194 Super User 2024 Season 2 on at
    RE: fileter against customer

    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
    Community Member Microsoft Employee on at
    RE: fileter against customer

    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

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,194 Super User 2024 Season 2 on at
    RE: fileter against customer

    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
    Community Member Microsoft Employee on at
    RE: fileter against customer

    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
    Mohana Yadav 59,194 Super User 2024 Season 2 on at
    RE: fileter against customer

    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

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans