4D v13.4

OBJECT SET FILTER

Home

 
4D v13.4
OBJECT SET FILTER

OBJECT SET FILTER 


 

OBJECT SET FILTER ( {* ;} object ; entryFilter ) 
Parameter Type   Description
Operator in If specified, Object is an Object Name (String) If omitted, Object is a Field or a Variable
object  Form object in Object Name (if * is specified), or Field or Variable (if * is omitted)
entryFilter  String in New data entry filter for the enterable area

OBJECT SET FILTER sets the entry filter for the objects specified by object to the filter you pass in entryFilter.

If you specify the optional * parameter, you indicate an object name (a string) in object. If you omit the optional * parameter, you indicate a field or a variable in object. In this case, you specify a field or variable reference (field or variable objects only) instead of a string. For more information about object names, see the section Object Properties.

OBJECT SET FILTER can be used for input and dialog forms and can be applied to fields and enterable variables that accept an entry filter in the Design environment.

Passing an empty string in entryFilter removes the current entry filter for the objects.

Note: This command cannot be used with fields located in a subform’s list form.

Note: In entryFilter, to use entry filters you may have predefined using the Tool Box, prefix the name of the filter with a vertical bar (|).

The following example sets the entry filter for a postal code field. If the address is in the U.S., the filter is set to ZIP codes. Otherwise, it is set to allow any entry:

 If([Companies]Country="US") ` Set the filter to a ZIP code format
    OBJECT SET FILTER([Companies]ZIP Code;"&9#####")
 Else ` Set the filter to accept alpha and numeric and uppercase the alpha
    OBJECT SET FILTER([Companies]ZIP Code;"~@")
 End if

The following example allows only the letters “a,” “b,” “c,” or “g” to be entered in two places in the field Field:

 OBJECT SET FILTER([Table]Field ;"&"+Char(Double quote)+"a;b;c;g"+Char(Double quote)+"##")

Note: This example sets the entry filter to &"a;b;c;g"##.

 
PROPERTIES 

Product: 4D
Theme: Object Properties
Number: 235

 
INDEX

Alphabetical list of commands

 
HISTORY 

Modified: 4D v6
Renamed: 4D v12

 
SEE ALSO 

OBJECT Get filter
OBJECT SET FORMAT