3 Replies Latest reply on Jun 12, 2012 11:22 AM by AnitaWoods

    Error message needed

    AnitaWoods

      Title

      Error message needed

      Post

      I am a novice user, working on a db for my home business, that I use on FM Go on my iPad. 

      I have a button for a Go to Related Record script that takes the user to a related record on a different layout.  I am wanting to have an error message, "no related record found" pop up if there are no related records. Right now if there are no related records, it just does nothing. How do I do create an error message pop-up?

        • 1. Re: Error message needed
          Sorbsbuster

          You could check the record count of the relationship before you GTRR.  For example:

          If (Count (That Relationship::SomeFieldThatIsNeverEmpty ) ) = 0

          Show Custom Dialogue ( "There are no records like that" )

          Else

          Go To Related Record

          End If

          • 2. Re: Error message needed
            philmodjunk

            Count will work, but can be a little slower than some other tests you can use:

            If [ IsEmpty ( relatedTable::FieldNeverEmpty ) // there are related records here ]
                GTRR
            Else
                Show Custom dialog ["No related records..."]
            End IF

            Another method that can be used with most versions of GTRR is:

            GTRR
            If [ Get ( LastError ) // No related records ]
                Show Custom Dialog [
            Else
             Put rest of your script here
            End If

            • 3. Re: Error message needed
              AnitaWoods

              First script worked perfect.  Can't say enough how much I appreciate you, PhilModJunk.  Someday, I swear, I'm going to send you cookies.