Sometimes the left list in a function can be a bit overwhelming when it contains every record. Did you know it’s possible to created another left list that contains only the data you need? Below are the steps to create a browser object with filter criteria. By following these steps a ‘drawer’ or ‘tab’ on the left list will be created making it quicker and more simple to find the records you need to see.
Navigate to Development > Script Dictionary > Objects
Click ‘New’ to start a new record
Give your object an identifying code & a description. Use the selection icon to choose a linked table
On the General tab, give your object an activity code and choose ‘Browser’ as the management type.
Also on the General tab, make sure your standard & specific script names populate. You will need the specific script name later.
Usually on an object you pick, from the linked table, which fields to display, as below. The SOH object, for example, in the selection screen block, you would define an index (SOH0) then specify a table and field from that table to display. For our browser object, we will do this in the specific script.
Click the ‘Create’ button to create your object.
Create your specific script and add the following piece of code to the Action label:
When "CLE_GAUCHE" : Gosub CLE_GAUCHE
This action is called before loading the left list
Next, create the action label block:
$CLE_GAUCHE
return
This is where you will define the filter criteria for your left list drawer by using the variable ‘FILTSUP’. The filter criteria is expressed in a string with logic to combine criteria. See below for an example.
FILTSUP = 'SOHCAT = 4'
This will filter the left list for sale orders that are categorized as contract types. If you need a more complex filter see how to add more criteria below.
FILTSUP = '(SOHCAT = 4 OR SOHCAT = 3) AND CPY = 111'
This would filter the left list for sale orders categorized as contracts or direct invoice and also looking for the company to be ‘111’.
###########################################
$ACTION
Case ACTION
When “CLE_GAUCHE : Gosub CLE_GAUCHE
Endcase
###########################################
$CLE_GAUCHE
FILTSUP=FILTSUP = '(SOHCAT = 4 OR SOHCAT = 3) AND CPY = 111'
Return
###########################################