Function overview
Prototype
Portal_Filter (
Field; FirstCharacter; LastCharacter; All )
Parameters
Field Field name
FirstCharacter This is the starting Character i.e. "A"
LastCharacter The last Character is "z"
All if 1 will show all related values
Description
Tags:
Filter
Some portal filter functions require the use of a greater than and less than to create and upper and lower boundary to show the records. This create a list of all the values if the filter field is empty. It use the Code function to get the boundaries for the custom list.
Oreste
Examples
Sample input
Portal_filter ( Filter Global ; "A"; "z" ;1)
Sample output
Shows a list of all characters from A to z if the field is empty, if not is puts in the field value
Function code
/*
Portal_Filter ( Field ;FirstCharacter;LastCharacter;all)
This function will allow the = sign to be used in a relationship rather than both agreater then less than equal signs. It puts in a list of all the values in the filter if the main filter is empty showing all, if all is set to 1.
*/
Let ( [
_field = Field ;
_FC=Code(Left ( FirstCharacter ; 1 ));
_lc = Code(Left ( LastCharacter ; 1 ));
_All=If (all;CustomList ( _fc; _lc ; "char ([n])" );"")
];
Case (
IsEmpty(_field); _all;
_field )
)
// ===================================
/*
This function is published on FileMaker Custom Functions
to check for updates and provide feedback and bug reports
please visit http://www.fmfunctions.com/fid/221
Prototype: Portal_Filter( Field; FirstCharacter; LastCharacter; All )
Function Author: kaostika (http://www.fmfunctions.com/mid/161)
Last updated: 08 May 2009
Version: 1
*/
// ===================================
/*__LITBR__Portal_Filter ( Field ;FirstCharacter;LastCharacter;all)__LITBR__This function will allow the = sign to be used in a relationship rather than both agreater then less than equal signs. It puts in a list of all the values in the filter if the main filter is empty showing all, if all is set to 1.__LITBR____LITBR__*/__LITBR__Let ( [__LITBR____LITBR___field = Field ; __LITBR___FC=Code(Left ( FirstCharacter ; 1 ));__LITBR___lc = Code(Left ( LastCharacter ; 1 ));__LITBR___All=If (all;CustomList ( _fc; _lc ; "char ([n])" );"")__LITBR____LITBR__ ];__LITBR____LITBR____LITBR__Case (__LITBR__IsEmpty(_field); _all;__LITBR____LITBR___field )__LITBR__)__LITBR____LITBR__// ===================================__LITBR__/*__LITBR____LITBR__ This function is published on FileMaker Custom Functions__LITBR__ to check for updates and provide feedback and bug reports__LITBR__ please visit http://www.fmfunctions.com/fid/221__LITBR____LITBR__ Prototype: Portal_Filter( Field; FirstCharacter; LastCharacter; All )__LITBR__ Function Author: kaostika (http://www.fmfunctions.com/mid/161)__LITBR__ Last updated: 08 May 2009__LITBR__ Version: 1__LITBR____LITBR__*/__LITBR__// ===================================
Login or register to comment
Create a new account with fmcustomfunctions.com or login to post a comment.