5 Replies Latest reply on May 30, 2010 12:18 PM by mrvodka

    Test if related record exist



      Test if related record exist



      I'm using FileMaker pro 10 on Windows Vista, and I want to create a script that will change the value of a checkbox to "checked"  if a related record is created, and that box will be unchecked if the related record is deleted.


      Thank you in advance.



        • 1. Re: Test if related record exist

          not IsEmpty ( Child::pkChildID )


          Create a value list with just 1 as the only value. Use that as a checkbox.




          There is also a  way to display a number as a boolean result as a check mark using Wingding but the first option is probably easier for you.



          • 2. Re: Test if related record exist

            with what kind of trigger i can assign my script,

            and if you please elaborate more on Wingding.

            • 3. Re: Test if related record exist

              Its not a script. You would create a calculation field that check if a related child record exists by using not IsEmpty ( ) on the primary ID which every record should have.



              As for the Wingding, with a number, one can format the type as a boolean ( Data formatting section in Inspector ). If one were to use the ü character to show the non zeros and use a Wingding font, you can just put the related child ID directly on the parent layout without using a calculation.


              If you dont care about a check and can live with YES or some other text, then you can use the same option as displaying as a boolean ans just use "Yes" instead of the ü.

              • 4. Re: Test if related record exist

                Sorry for the inconvenience, but I've created a check box with a value list with one value: "Yes", and added to the calculated value section of that field : If(not IsEmpty(PKchild:child); "Yes"; "") , and that didn't work!!!!!, what am I missing here.

                • 5. Re: Test if related record exist

                  You missed my point earlier. If you are going to use "Yes" then just put the related ID field on the parent layout. Then select it and format it as "boolean" under the data tab of the Inspector ( FMP11 ) or in eralier versions, under the format menu --> Number.