Filemaker-like portal filtering

Hi,
How could I achieve with Servoy what I could do with Filemaker using the following formula?
“All” & “” & "Name: " & Left ( name_field ; 1 ) & “” &
"Location: " & Left ( location_field ; 1 )

This formula would be in a calculation field for every record. Then I’d create a valuelist based on that field and would assign that valuelist to a global text field in order to filter a portal.

Thanks in advance,
Miguel Angel.

flusheddata:
Hi,
How could I achieve with Servoy what I could do with Filemaker using the following formula?
“All” & “” & "Name: " & Left ( name_field ; 1 ) & “” &
"Location: " & Left ( location_field ; 1 )

This formula would be in a calculation field for every record. Then I’d create a valuelist based on that field and would assign that valuelist to a global text field in order to filter a portal.

Thanks in advance,
Miguel Angel.

You can do it but remember to use the javascript syntax in the calc:

return 'All'+'\n'+'Name: '+utils.stringLeft(name_field,1)+'\n'+'Location: '+utils.stringLeft(location_field,1);

And create a relation with the global field you are using as filter on the left side and the calc on the right side.
Then you can put a portal or a tab panel in the form showng records based on the realtion.

Thanks for your quick reply.
The calculation field shows ‘All Name: J’ with no carriage return.
The valuelist also shows ‘All Name: J’.

What I need the value list to show is:

All
Name: A
Name: C
Name: W

for records Alice, Allison, Charles, Winston and William

Hi Miguel,

You can do this a number of different ways in Servoy:

  1. Have an “onRecordSelection” event that will change the valuelist above the portal (or better - a listview in a tabpanel) based on the related records (either with a SQL query or looping through the related records)

  2. Have a plain global field above the listview and attach an “onAction” method that will do a find in the related data for the string that they type in.

Personally, I like using listviews (in table view or not, your choice) in tabpanels rather than portals - you can find/sort easily.

Hope this helps point you in the right direction.