Filter Data not to be included in Location List

vasilis6669vasilis6669 Member Posts: 109
Hi,

How can i filter some location List not to be included on a particual report?

Thanks,
Vasilis

Answers

  • kapamaroukapamarou Member Posts: 1,152
    Filter it by Code or by the user entering filters on the request form?

    Can you give us a bit more detail?
  • vasilis6669vasilis6669 Member Posts: 109
    My mistake is not for a report is for a form.

    In the form there is the option to select location code. From the location code list i do not want to view some values from the list. Alos,I do not want to disable the location for all the forms.

    So, if there is logic:
    1) If the location list is opened by form 'SalesReport'
    2) Filter Location Code <>Store1|Store2

    vasilis
  • kapamaroukapamarou Member Posts: 1,152
    Declare a Variable LocRec (Record, Location) and LocForm (Form, Location List);


    Then in the OnLookup trigger write:
    CLEAR(locForm);
    
    // Here you cann apply any filter you need
    locform.SETTABLEVIEW(locRec);
    locform.LOOKUPMODE(TRUE);
    IF locform.RUNMODAL = ACTION::LookupOK THEN BEGIN
    
      locform.GETRECORD(locRec);
      VALIDATE("Location Code",LocRec.Code);
    END;
    
  • vasilis6669vasilis6669 Member Posts: 109
    ok, but how do i filter with data not to be included in the location list. I do not know the sytax

    Location.SETFILTER(Code,not 'Store1'|'Store2');

    Euxaristo,
    vasilis
  • kapamaroukapamarou Member Posts: 1,152
    You can do the following:


    Location.SETFILTER(Code,'<>%1&<>%2&<>%3',Store1,Store2,Store3);


    But I would add a new field and filter based on this because a filter like the one above can cause a runtime error if the length exceeds a certain number of characters...


    The above filter tells the system to show only the records that are Not Store1 AND Not Store2 And NOT Store3...


    You can read the online help for more information on applying filters...
  • vasilis6669vasilis6669 Member Posts: 109
    ok thanks,

    i used Location.SETFILTER(Code,'<>Store1|Store2|Store3|Store4|Store5');

    vasilis
  • kapamaroukapamarou Member Posts: 1,152
    i used Location.SETFILTER(Code,'<>Store1|Store2|Store3|Store4|Store5');

    Is this what you want????

    This will exclude ONLY Store1... which is equal to saying:
    Location.SETFILTER(Code,'<>Store1');
  • vasilis6669vasilis6669 Member Posts: 109
    Yes, you are right. It did not check the other values.

    Thanks
  • bandwidthbandwidth Member Posts: 4
    for Location.SETFILTER(Code,'<>%1&<>%2&<>%3',Store1,Store2,Store3);

    I meet an error message which says a maximum of 12 parameters must be used....

    So I think the limit may be 12 parameters. Thank you.
  • canadian_baconcanadian_bacon Member Posts: 91
    You can do this with the MARK function to iteratively select the records you want to view and then use MARKEDONLY to view only those records.
    Hopefully you don't have a lot of records in your location table.
Sign In or Register to comment.