4 Replies Latest reply on Feb 9, 2010 2:27 AM by ianmanning

    Changing error messages

    ianmanning

      Title

      Changing error messages

      Post

      I use calculation based limited Privileges to stop users accidentally changing fields after they have been created. The calculation looks at a boolean lock field that can be changed by the user if they need to make changes.

       

      The users (not Administrators) do not have the privileges or the ability to unlock some fields.

       

      My problem is that they get the same error message if they try to change either type of field. (fields they can't change and fields they may be able to change)

       

      For example:

      They cannot ever change the customers unique reference number, if they try, they get the error message that they do not have the privileges..

      They can change the customers email address if the record is "unlocked" when the record is processed the lock field is automatically set so that accidental changes cannot be made. However if they mis-spelt the email address they can unlock the record, change the address, resend the email and the process will automatically lock the record afterwards. If the record is locked and they try and change it they will get the same error message that they do not have the privileges..

       

      I would like to be able to change the error message if it is a field they could unlock to tell them that the record is locked not that they don't have the privileges.

       

      Can this be done?

       

      I hope my ramblings aren't too confusing.

      Best regards

      Ian

        • 1. Re: Changing error messages
          philmodjunk
             If you are using filemaker 10, you could set script triggers on the fields set to fire "onObjectEnter" that check for the lock condition and then use show custom dialog to inform the user with the message you want them to see.
          • 2. Re: Changing error messages
            ianmanning
              

            Hi Phil,

            Thanks for the reply.

            Am I right in thinking that I could replace the privilages completely with multiple onObjectEnter scripts. one would 'bounce' them back out of the object after showing the custom message 'you cant do that...' another would either allow them to continue (enter the field) or bounce them out with a 'this record is locked' message. I guess the main difference is that the privilages are global but the script would have to be applied to each field.

            Thanks for your help it will make the database much more friendly.

            Best regards

            Ian

            • 3. Re: Changing error messages
              philmodjunk
                 You'll have much better security if you keep the access privileges. With script triggers, you have to be completely consistent from layout to layout and this can make future updates a real nightmare in many database solutions.
              • 4. Re: Changing error messages
                ianmanning
                  

                Hi Phil,

                To make it work I found that I had to keep the privileges as the popup did not show untill I clicked out of the field (I checked that I had not set the on exit by mistake) I modified the custome message so that they can select either OK or Unlock from the pop up so now they are atleast told why they do not have the privileges afert they close the error message and the can unlock the record from the second message.

                Two clicks insted of one but they would have had to close the first error and realise that the record was locked then click on the unlock buton on the layout before so we have improved a bit.

                Thanks for your advise.

                Ian