Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Add a "Show All" to value list...


Stephen Wallace
 Share

Recommended Posts

Hello!

 

I have a value list that is created by pulling in related values via a relationship. Everything is working just fine but I would now like to add at the top of that value list a "Show All" option so that the user may choose to filter a portal via the related values or to continue viewing all records.

 

Any thoughts?

 

Thanks!

Stephen

Link to comment
Share on other sites

You can't; a value list is EITHER a custom value list (which could have "Show All" but can't pull its values from a field, related or otherwise) or ELSE draws its values from a field (in which case it can't have "Show All" unless you create a RECORD containing "Show All" in the relevant place... which in the case of related values only would require a lot of "Show All" records or an additional kludge).

 

In your other thread I had suggested you attach a "Show All" BUTTON to your layout that lets the end user assign the value "Show All" to the field instead of picking it from the dropdown value list.

Link to comment
Share on other sites

You Can!

 

Create a calculation field call c_PortalFilter which eqauls

"_Show All" & ¶ & Your Table::YourFieldWithValues

 

Use this new field in the related Value list In your global filter field that is now related to the above field

 

use the related value list it produced. _Show All floats to the top of the list for your user to choose.

 

Since the calculation is defined as _Show All and the content of your field, when the user chooses it all records will shows in the portal.

 

Scripts to set your filter(s) to _Show All are also recommended.

Link to comment
Share on other sites

Aha, clever!

 

I'd thought of a calcfield in the LOCAL table defined as "Show All" & "¶" & ValueListItems (get (FileName); "OriginalValueList") but rejected it because it could not be indexed and also remain dynamic. By adding the calcfield to the PORTAL table you eliminate that problem — the VL will include "_Show All" only once although each related rec will have that as one of its values.

 

**adds to list of tricks**

Link to comment
Share on other sites

Just for the sake of discussion, you could also use the Virtual List technique. You can build Value Lists on the fly. You use a relationship on the Virtual List table and that forces FileMaker to index it.

 

It's a little more involved than Chopper's suggestion, but has other benefits once you understand the basic premise.

Link to comment
Share on other sites

Chopper:

 

Thanks for the reply. I believe I have something much like this working as I have been working on it. However, when I save the value list, it gives me the error about not being able to index a calculated field, blah, blah blah. Proceed anyway? Is it possible to get this error and still have the value list work? Or will your way not provide that error?

Link to comment
Share on other sites

You Can!

 

Create a calculation field call c_PortalFilter which eqauls

"_Show All" & ¶ & Your Table::YourFieldWithValues

 

-- This part I understand. I created a calc in my "Regions" table.

 

Use this new field in the related Value list In your global filter field that is now related to the above field

 

-- This part I didn't quite get. Currently, I have a relationship between the State and Region tables. I am telling the value list window to use the values from from table regions::values, and also have checked "Include only related values from the States table."

 

use the related value list it produced. _Show All floats to the top of the list for your user to choose.

 

-- When I save the value list, it gives me the error about using a field that can't be indexed, etc. Proceed anyway? I say yes, and the value list works perfectly. That's what I am not sure about, that error message.

 

Since the calculation is defined as _Show All and the content of your field, when the user chooses it all records will shows in the portal.

 

Scripts to set your filter(s) to _Show All are also recommended.

 

Any other thoughts?

 

PS - I was able to get it to sort perfectly by using the option "Sort using Unicode"

Link to comment
Share on other sites

1] Index the new calculation field in the fields options

 

2] In the valuelist that is using a related values from field , change it to the new Indexed field.

 

3] example of relationship. (theses are my field)

g_Asset_Type :: c_Asset_Type

 

4] In the layout click on g_Asset_Type and assign the Related ValueList to it

 

5] Play with field with that has the vl attached to it. change values in it , watch portal results change.

Link to comment
Share on other sites

 Share



×
×
  • Create New...

Important Information

Terms of Use