开发者

FileMaker Pro -- Filtering Relationship Not Working

I'm trying to build a FileMaker Pro 11 layout that excludes records containing a certain value. The relevant data is in table Invoice. I want to filter so that Invoice records whose "Invoice Check Grouping" field is blank are not displayed on the layout.

I've added a global field to the invoice table called "Blank Invoice Check Grouping" to use as my filter criteria. I've created a self-join r开发者_StackOverflow中文版elationship to the Invoice table, joining "Invoice ID" to "Invoice ID" and joining "Invoice Check Grouping" to "Blank Invoice Check Grouping". The resulting table is named "Invoice Check Groupings".

The layout which I build based on table "Invoice Check Groupings" shows all records in Invoice--it does not filter out those with blank values. What am I doing incorrectly?

Thanks,

Ben


Layouts show records in a table (or more accurately, a table occurrence) and don't directly deal with related data. As mentioned by @pft221, you can use relationships for filtering, but only when viewing data through a portal.

If you always want a particular layout to show data based on a particular find, you can do so with a script and a script trigger. First set up a script to do the following:

Enter Find Mode[]
Set Field["Invoice Check Grouping"; "*" // Find all records with any data in this field
Perform Find[]

Note that you can also embed the find request within the Perform Find script step, but I tend to script finds in the above manner as it's easier to see what the find request is in the script and variables can be used in the find request.

Now you need to set your layout to execute this script whenever it's loaded. Go to the layout and enter Layout Mode. Select Layouts>Layout Setup from the menu bar. Click the Script Triggers tab and check the box for OnLayoutEnter and select the script you wrote above. Now whenever the layout is entered, that script will run and exclude the records that have that particular field being empty.


There are many ways to filter records, depending on what you are trying to do and what you are trying to display for your users.

The most common and simple way you can filter records is through a simple Find in a list view. I'm unclear from your question, but my best guess is that you're already using a list view and misunderstanding how FileMaker's relationships and Table Occurrences (TO's) work.

To Filter with the "Find Records" method:

  1. Create a new List View layout of any Table Occurrence of your Invoice Table -- most likely you will want to use the default Table Occurrence that FileMaker created for you when you created the table.
  2. Place the fields that you would like to display on that layout, including the "Invoice Check Grouping" field.
  3. Switch into Find Mode
  4. Put a '*' character into the "Invoice Check Grouping" field
  5. Perform the Find

You should now see a list of all Invoices where the "Invoice Check Grouping" field is not blank. (You can find additional interesting search criteria in the "Insert: Operators" drop down of the title bar.)


Now you may actually be looking to filter related records through a portal but, given that you've set up a self-join on the Invoice index on the Invoice table my guess is that, at best, this would show either 0 or 1 record for each Invoice record you display in your main layout.

To Filter Records with the "Portal Filter" method:

Let's assume, though, that you have a Client table where you'd like to see only the records with a non-blank "Invoice Check Grouping" value. The table set-up would be as follows:

Client
  Client ID
  [... other client info ...]

Invoice
  Invoice ID
  Client ID
  Invoice Check Grouping
  [... other invoice info ...]

With a relationship in the relationships graph:

 Client::Client ID  ------< Invoice::Client ID

From there you would set up a Form layout on the Client TO and create a portal showing records from the Invoice TO. From the options for the portal you would select "Filter Portal Records" and use a formula similar to:

 not IsEmpty(Invoice::Invoice Check Grouping)

Finally, it's worth noting that a portal filter isn't appropriate for all display situations or calculations. You can set up a similar filter completely through your relationships graph (as I believe you have already tried to do.) This will work, once again, for viewing records through a portal but not for the records displayed by a layout itself.


The answers above don't actually help Ben with his question. They are workarounds.

I have the same problem as Ben, and I don't think there is a solution, even now in Filemaker 12. There is I think no way to define a relationship that will omit the related records where the match fields are empty.

Two options come to mind: On a specific layout, you have more fine-grained control in the portal definition itself, and can use this to exclude the records You can now use SQL queries to achieve this result within Filemkaer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜