SetBrowseFilter

I'm trying to use the SetBrowseFilter method with an external script using the AR_Customer_ui object. and the InvokeLookup method. I need to show only Active Customers with a SortField set to a value. I can't seem to find any documentation for the SetBrowseFilter argument string. Can someone post an example of setting Active and SortField with this method?

The SetBrowseFilter function is in SY_Service which AR_Customer_ui or AR_Customer_bus doesn't seem to inherit. It looks like AR_Customer_svc does inherit SY_Service. Would the best approach be to instantiate AR_Customer_svc along with my AR_Customer_ui?

Parents
  • 0

    SetBrowseFilter works with one of the table's indexes.  Choose your index, set a value (as the beginning text for that index), and scroll through the filtered list (remembering to set the index back when done).  It doesn't work for any field of your choosing.

    When I need to get a list for specific alternate criteria (independent of the available indexes), I use an ODBC "select" query.

  • 0 in reply to Kevin M

    Thanks Kevin for your reply and support. The default browse Index is fine for this project. I just need to set the browse filter so only active customers and records that contain a value I set for sort field are shown. If I set these filters in 100 and save the filter it works as expected when the customer InvokeLookup is called via BOI. The InvokeLookup also has an optional 3rd parameter to set the start record for multi-keyed files. (Customer Contact passing the customer number) It would be awesome if the InvokeLookup also supported passing a filter string as well. 

    Can you post an example of setting the SetBrowseFilter string so that Status="Active" and the SortField I defined are shown? Hopefully setting the SetBrowseFilter also affects the ALE lookup. Do you know where the custom filter string is stored when you save it in 100? I will also need to do something similar for my Items lookup with setting a custom filter.

  • 0 in reply to scmember

    Invoking an ALE is a completely different and separate function to SetBrowseFilter. 

    There is no way to use alternate fields / filters with SetBrowseFilter (AFAIK), only index based filters.  No "example" is available using Status or SortField.  (It's for things like scrolling through open SO filtered to a specific customer's orders, using the KCustomer index in SO header).  A Master Developer could probably add an index for other fields, but that is not within my skill set.

    If you want to set up an ALE with your filter, and invoke that... it would likely use the filter set in the ALE (not something dynamic passed as part of the script) but I haven't played with InvokeLookup before so I'm not sure what is possible there.

Reply
  • 0 in reply to scmember

    Invoking an ALE is a completely different and separate function to SetBrowseFilter. 

    There is no way to use alternate fields / filters with SetBrowseFilter (AFAIK), only index based filters.  No "example" is available using Status or SortField.  (It's for things like scrolling through open SO filtered to a specific customer's orders, using the KCustomer index in SO header).  A Master Developer could probably add an index for other fields, but that is not within my skill set.

    If you want to set up an ALE with your filter, and invoke that... it would likely use the filter set in the ALE (not something dynamic passed as part of the script) but I haven't played with InvokeLookup before so I'm not sure what is possible there.

Children