Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.filemaker > #3256

Re: Detecting No Related Records

From Helpful Harry <HelpfulHarry@BusyWorking.com>
Newsgroups comp.databases.filemaker
Subject Re: Detecting No Related Records
Date 2019-07-30 13:27 +1200
Organization Aioe.org NNTP Server
Message-ID <qho6eo$ofp$1@gioia.aioe.org> (permalink)
References <1obhm6m.hdoyrw1jr4ctoN%csampson@inetworld.net>

Show all headers | View raw


On 2019-07-30 01:13:20 +0000, Charles H. Sampson said:

> How do I detect that a record has no related records? I've found that
> "Go To Related Record" doesn't protest if there are no related records
> so catching an error doesn't work. I've also searched the Get functions
> for something that returns a count of related records to no avail.
> 
> Charlie

There's probably a few ways, but perhaps the easiest is to simply count 
the number of related records using a related field that must always 
contain data - the obvious one being the related records' Child-Key 
field itself. In the Parent Table, you can create a Calculation field 
like:

    NumRelatedRecords    Calculation, Number Result
        = Count(Relationship::Related_Child_KeyField)

or you can simply use the same calculation in a Script, within an If 
statement's test for example..

If that calculates as zero, then there are no related records.

You may even already have that field in the Parent Table since it can 
often be handy to display the count underneath a Portal.


Helpful Harry  :o)

Back to comp.databases.filemaker | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Detecting No Related Records csampson@inetworld.net (Charles H. Sampson) - 2019-07-29 18:13 -0700
  Re: Detecting No Related Records Helpful Harry <HelpfulHarry@BusyWorking.com> - 2019-07-30 13:27 +1200
    Re: Detecting No Related Records csampson@inetworld.net (Charles H. Sampson) - 2019-07-30 19:27 -0700
      Re: Detecting No Related Records none@gmail.com - 2019-07-31 20:35 +0200

csiph-web