0 Replies Latest reply on Oct 2, 2012 1:15 PM by vince.menanno

    HasRelatedRecords & RecordCount 2 new Table Occurrence functions

    vince.menanno

      Not sure what you call it but I remember when 7 first came out we thought to use IsValid to ask a field that you know has a value to deterime if you had related records. Only after a while did we realise that this was not the intension of using IsValid.

       

      So now I think the consense is to use IsEmpty ( RELATED_TABLE::ID ) knowing that ID will always have a value.

       

      So before going to related records you can ask to see if you have related records.

       

      Maybe even something new and very efficient to just check from the context that you are evaluating it from and just giving it the table occurrence name - somethign like this.

       

      HasRelatedRecords ( TABLE_OCCURRENCE )

       

      Maybe it could return Ture or False...

       

      It can also handle the situations where you want to see all related records for the found set and yet the record you are sitting on doesn't have any related reocrds.

       

      And maybe another Similar function like

       

      RecordCount ( TABLE_OCCURRENCE )

       

      Sometimes for this function we have been using the aggregate function Count ( RELATED_TABLE::ID )

       

      Again not really sure if there could be some efficiencies with just specifing the table occurrence and FileMaker can return a record count.

       

      Again deterimed from runtime and from the context which you ask it.