3 Replies Latest reply on Jul 8, 2013 11:03 AM by philmodjunk

    Field Validation without affacting other Required fields.

    IanAllan(newuser)

      Title

      Field Validation without affacting other Required fields.

      Post

           I have a table with several fields formatted Required Value. The table also has a field that must meet a Validation by Calculation test. I have used the OnObjectValidate trigger to test the contents of that field. Unfortunately my test also generates dialogues for all the Required Value fields that are at this point empty. How can I surpress these other messages until the record is committed?

           Ian Allan

        • 1. Re: Field Validation without affacting other Required fields.
          philmodjunk

               PLease post the script you have set up to be performed by the OnObjectValidate trigger. It sounds like your script is committing the record.

               To post a script to the forum:

                 
          1.           You can upload a screen shot of your script by using the Upload an Image controls located just below Post A Answer.
          2.      
          3.           You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here. (with this approach, you can get multiple script steps on the same line, please edit the pasted text by inserting some returns to separate those steps.)
          4.      
          5.           If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
          6.      
          7.           If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format.
          • 2. Re: Field Validation without affacting other Required fields.
            IanAllan(newuser)

                 You are correct Phil. The script was calling for a new record if validation failed. Fixed that but  I still don't have this working correctly though. Here is my script now:

                   
            •           If [ not (Contracts::cont_CustCode = Customers::cust_CustCode) ]
            •      
            •           Show Custom Dialog [ Title: "Error"; Message: "Sorry, we do not have a customer with that Code. Please click Cancel and then enter a Valid Customer Code."; Default Button: “Cancel”, Commit: “No” ]
            •      
            •           End If

                 Two Tables, Customer and Contract. Both have a CustCode field. What I want to do is to ensure that the user enters an existing (in the Customers table) code as the ContractCustomer code in the contracts table. I want FMP to notify the user as the user tabs out of the ContractCustomer code field  the FMP cannot find that particular code in the customers table.

                 For some reason the custom dialogue appears even if the test is met. When the dialogue is canceled the relation is estblished.

                  

                 Ian

                  

            • 3. Re: Field Validation without affacting other Required fields.
              philmodjunk

                   YOu need an ExitScript [False] step to return control to the field so that the validations aren't triggered.

                   But it should be possible to use a value list or other methods  to select from a list of existing customer codes instead of requiring the user to correctly enter one.