Filter Record Hook (R-CUFLTn.MAC, R-SUFLTn.MAC, R-STFLTn.MAC) ![]()
Corporate Edition Only
The script file must be located in your CAPITAL program directory and depending on the area that is being filtered, it may have the following range of file names:
|
Area |
File Name |
|
Stock Control |
R-STFLTn.MAC where n is a number between 0 and 9. |
|
Customer Accounts |
R-CUFLTn.MAC where n is a number between 0 and 9. |
|
Supplier Accounts |
R-SUFLTn.MAC where n is a number between 0 and 9. |
If the script is selected, it is executed every time a request is made to show a filtered view of the relevant section of the database. Scripts are selected using the Record Filters window.
Entry Values
None.
Return Values
A filter statement returned as a character string.
Comments
A filter script should consist of two lines of the following general lay-out:
* Name/Description of Hook
Return "X"
Where "X" is the filter condition.
Users may select up to 10 different filter conditions per area. For example, if you create the .MAC files R-STFLT0.MAC and R-STFLT1.MAC, both of these will be visible for selection from the Record Filters window.
Corporate
server based filter statements should only reference database fields pertaining to stock, customer or
supplier records. Complex CBS functions may not be included in expressions as the Corporate database server
is 'client independent' and will not recognise functions that reference the local environment rather than
the contents of the data in the table being filtered. For more information on this subject consult the
topic: Corporate
Edition Sort & Filter Expressions.
Example Filter Expressions
|
| ||
|
|
STOCK | |
|
|
Do not list stock items that are out of stock. | |
|
|
"Val(Stock_in) > 0" | |
|
|
STOCK | |
|
|
Only list stock items that are not on hold. | |
|
|
".NOT. Hold = 'Y'" | |
|
|
STOCK | |
|
|
Only list recently stock where we have more than 100 units of that stock available which has been assigned a stock group. | |
|
|
"Val(Stock_in) >= 100 .AND. .NOT. Len(Trim(Type)) = 0" | |
|
|
STOCK | |
|
|
Only list stock items that have arrived in the last 3 months that have not been fully allocated to customers. | |
|
|
"CTOD('" + DTOC(Today())'" + " - 90 > Delivery .AND. Val(Stock_in) - Val(Allocated) > 0" | |
|
|
CUSTOMERS | |
|
|
Only view customers assigned to the user's department or for which no department has been assigned. | |
|
|
"Cusdepart = '" + DepSet + '" .OR. Len(Trim(Cusdepart)) = 0" | |
|
|
SUPPLIERS | |
|
|
List all suppliers who work in US dollars. | |
|
|
"Currency = 'USD'" | |
|
|
SUPPLIERS | |
|
|
List all suppliers who match the current default department code. | |
|
|
"Department = '" + DepSet + '" .OR. Len(Trim(Department)) = 0" | |
Example Filter #1
* List Suppliers in US Dollars
Return "Currency = 'USD'"
Example Filter #2
* Available Physical Stock
"Val(Stock_in) > 0"
____________________________
Related Topics:
Corporate Edition Sort & Filter Expressions
![]() |