5 Replies Latest reply on May 26, 2011 12:15 PM by philmodjunk

    Change a field for one user

    jeffd

      Title

      Change a field for one user

      Post

      How to properly do the following?

      We share a database on FM Server11. On a particular layout we show machine cost & profit margin. From time to time we may have a customer stand over our shoulder to watch what we are doing and it becomes tough for him not be able to see cost & margin figures. I am wanting to have the user select this "Customer View" field which would be a "Yes" or "No" so as to hide the cost & margin fields (via conditional formatting) if the users so desires.

      The trick would be for this option to change on to a "Yes" or "No' only on his view & not for all of our users if they are looking at the same record.

        • 1. Re: Change a field for one user
          philmodjunk

          You can use a global field or a global variable to record the current "view" status.

          Your conditional format expressions would look like this:

          $$Invisible

          or

          YourTable::gInvisible    (gInvisible would be defined with global storage.)

          Since global field and global variable values are specific to each user on your system. Setting this field or variable to True will only affect the view of the user where the value is set.

          You can use a button to set the value of a variable and the global field could be formatted with a check box value set that enters 1 if the check box is selected and which clears the field if it is cleared by clicking it a second time.

          • 2. Re: Change a field for one user
            jeffd

            Ok PhilModJunk,

            You have helped me once again. This works but I would like to take it one step further if I can. Is it possible to turn the global field to "off" or "on" to only one record at a time (current record) ?

            • 3. Re: Change a field for one user
              philmodjunk

              Use your button to capture the current record's record ID:

              Set Variable [$$RecordID ; Get ( RecordID ) ]

              Your conditional format expression then becomes:

              $$RecordID = Get ( RecordID )

              • 4. Re: Change a field for one user
                jeffd

                I understand this approach & I'm sure it work but I don't know how to set two variables to one button.

                Would you explain a little for me please.

                Thanks.

                • 5. Re: Change a field for one user
                  philmodjunk

                  You must have read my first version of this response before I noticed that setting two variables was not needed. See my later version shown above. (To set two variables from one button click, you write a script that sets the variables and then your button uses Perform Script to run the script.)