10 Replies Latest reply on Oct 22, 2013 10:04 AM by philmodjunk

    Help with a Parameter

    shae1725

      Title

      Help with a Parameter

      Post

           Can a Global Parameter be set on creation/modify of a specific records field?

            

        • 1. Re: Help with a Parameter
          philmodjunk

               There is no such thing as a "global parameter". There is such a thing as a global variable and a global field is also possible.

               Can you describe what you want in more detail?

          • 2. Re: Help with a Parameter
            schamblee

                 I don't really understand your question.  Global means it is available in all script which is what a global variable is.  A parameter can assign a value to a global variable. Why not use a global variable? ($$sample)

            • 3. Re: Help with a Parameter
              shae1725

                   Apologies

                   Global Variable

                   Can you set a Global Variable when you create/modify a specific field!

                   The Variable is to be set for record 1 of  a table

                    

              • 4. Re: Help with a Parameter
                philmodjunk

                     But you don't create fields while in browse mode. You create records.

                     Can you spell this out in a bit more detail? Maybe with an example? Otherwise, I'm still making guesses as to what you want.

                • 5. Re: Help with a Parameter
                  shae1725

                        

                       Can you set a Global Variable when you create/modify a specific fields CONTENTS!

                       i want a variable set when data enters or is modified in a specific field!

                       Its to avoid  constantly having to set the variable in scripts!

                  • 6. Re: Help with a Parameter
                    philmodjunk

                         And what value do you want to set?

                         Sounds like something that can be set with the Let function in an auto-enter calculation but as I don't know what value you want to set, it's hard to be specific.

                    • 7. Re: Help with a Parameter
                      shae1725

                           I am not sure how else I can explain!

                            

                           Field A contains a value of:  eg "204"

                           $$FieldA = "204"

                           Can you set a variable with the let function?

                           Apologies if I am being vauge

                      • 8. Re: Help with a Parameter
                        philmodjunk

                             OK, that provided a key piece of info. You want the contents of the field copied to the variable.

                             A conditional format expression can use let to assign this value.

                             I don't normally use this technique so I experimented to see what would work.

                             I used this auto-enter calculation:

                             Let ( $$FieldA = self ; self )

                             And cleared the "do not replace existing value" check box.

                             But it can be tricky to confirm that this works. The variable doesn't automatically appear in the Data Viewer (FMP Advanced) and if I put the variable as merge text on the layout, I don't see the value change on the layout until I refresh the window. So this should work, but you may not see a visible change without a bit of scripted support and if you have to do that, you may want to just use the script to assign a value to the variable anyway.

                        • 9. Re: Help with a Parameter
                          shae1725

                               you're right doesn't work without scripting anyway.

                                

                          • 10. Re: Help with a Parameter
                            philmodjunk

                                 It works for many uses, but not if you want to display the value on the layout immediately after editing the field.