Setrange or Setfilter on ore than one field

guptavarunmcaguptavarunmca Member Posts: 95
Hello All

I want to setfilter the data on more than one field in table with any specific field.

Scenario.
I has two customized field in Sales Header New Location Code,Old Location Code.

I want to setfilter the data on the basis of Location Code,New Location Code,Old Location Code

Setfilter("Location Code"|"New Location Code"|"Old Location Code",'DELHI') Is it possible in NAV if yes then how

Please do your reply if you have any idea,
With Best Regards:
VARUN K. GUPTA

Comments

  • SogSog Member Posts: 1,023
    Based on this question
    I want to setfilter the data on more than one field in table with any specific field.

    Scenario.
    I has two customized field in Sales Header New Location Code,Old Location Code.

    I want to setfilter the data on the basis of Location Code,New Location Code,Old Location Code

    Very basic anwer: For each field you want to filter you'll have to put a setrange/setfilter on each field:
    setrange("location code",'DELHI');
    setrange("new location code",'DELHI');
    setrange("old location code",'DELHI');

    Since you use | in your wrong filter I think you mean to OR the filters on the different fields.

    That scenario is with only user interaction almost impossible, with code, see the post of mohana_cse06
    If an end user wants to do that, he has to filter one one field first, mark the records (ctrl+f1, see menu edit)
    filter on the next field, mark the new ones (else the mark will be gone on records with filter on field 1 AND filter on field 2)
    do this for the next fields, and then remove all filters, and in the menu view select marked only.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • abhinav0408abhinav0408 Member Posts: 35
    Setfilter("Location Code"|"New Location Code"|"Old Location Code",'DELHI')

    this is not possible in NAV but you can filter one feild with multiple values
    Setfilter("Location Code",'%1|%2|%3','DELHI','MUMBAI','CHENNAI')

    To do the multiple filters you have to setfilter as mentioned by Sog...
Sign In or Register to comment.