12 Replies Latest reply on Aug 6, 2014 5:00 PM by Malcolm

    Go to Field on popover

    davehob

      I’m performing a script from a button on a popover that includes “Go to Field [fieldname]”. The field is on the popover, but is also on the underlying layout. The script step goes to the field on the layout, and not the occurrence of the field on the popover. Is there any way to change this, i.e. “if the field is on the popover, go there”?

        • 1. Re: Go to Field on popover
          erolst

          Give the field an object name, then use “Go to Object”.

          1 of 1 people found this helpful
          • 2. Re: Go to Field on popover
            davehob

            Yes I could do that, and distinguish between different occurrences of the same field by giving them different object names, and then passing the object name as a parameter. I guess without that distinction, control will always go to the first occurrence of the field (i.e. nearest the top left of the "main" layout)?

             

            Thanks for your help.

             

            Dave.

            • 3. Re: Go to Field on popover
              keywords

              I'm not sure that "first occurence" is necessarily a position thing. I've always thought it is the one that was put there first.

              • 4. Re: Go to Field on popover
                davehob

                You're right - it is the one that was there first. 

                 

                Which prompts me to ask a follow-up question.  I'm trying to locate a field on a layout.  "FieldNames ( Get ( FileName ); Get ( LayoutName ))" tells me that the field is on the layout somewhere, but I can't find it.  Furthermore, a "Go to field" button returns error 102 - "field is missing".  What's going on?

                • 5. Re: Go to Field on popover
                  Malcolm

                  I'm not sure that "first occurence" is necessarily a position thing. I've always thought it is the one that was put there first.

                   

                  That’s often true, but it is only a coincidence. The Z-index controls the order.

                   

                  Malcolm

                  • 6. Re: Go to Field on popover
                    keywords

                    I was able to replicate that as follows:

                     

                    1.     Put two instances of a field on a layout, one on a popover, then a second on the layout itself.

                    2.     Create a single step button to navigate to the field—result: it goes to the field on the popover as that was put there before the other.

                    3.     Now set the field on the popover to disallow field entry (field behaviour settings in the Data Inspector)—result: button now fails, and returns error 102. NOTE: this is even though there is a second instance of the same field available, the button will not skip the one it can't enter and go to the one it can.

                    4.     Now create a script with a single Go to Field step and set the button to run that script instead—result: SUCCESS! This is because scripted navigation overrides any data entry restrictions you have in place.

                     

                    So, to come back to your situation, if you create a scripted go to field you should be able to locate the field, and I'll bet it is set to disallow field entry.

                     

                    Hope that helps.

                    1 of 1 people found this helpful
                    • 7. Re: Go to Field on popover
                      keywords

                      What is the Z-index? And can it be accessed?

                      • 8. Re: Go to Field on popover
                        davehob

                        That does help, and you're right - the script version of the button returns error 0.  However, even though the Go to field has executed successfully, the field is not showing up on the layout.  I guess this means that it's behind another layout object, so I think I need to dismantle the laout to find it.

                         

                        Thanks for your suggestion!

                         

                        Dave.

                        • 9. Re: Go to Field on popover
                          keywords

                          That's odd. Hope you find it somewhere!

                          • 10. Re: Go to Field on popover
                            davehob

                            I did!  It was off the active part of the layout.  What I didn't know until now (although it seems kind of logical) is that if you "go to" a field that is part of the layout but not on a layout part, you'll get error 102, unless you do the "go to" within a script, in which case you get error 0, but the field doesn't actually get focus - which makes it hard to find!

                             

                            Thanks again,

                             

                            Dave.

                            • 11. Re: Go to Field on popover
                              erolst

                              keywords wrote:

                               

                              What is the Z-index? And can it be accessed?

                               

                              1. The stacking order, and 2. not programmatically, to my knowledge (which isn't saying much).

                              • 12. Re: Go to Field on popover
                                Malcolm

                                What is the Z-index?

                                 

                                All objects on a layout have an z-index number which is used to display them. If two objects overlap the object with the higher z-index number is above the other object.

                                 

                                And can it be accessed?

                                 

                                Try this:

                                 

                                FieldNames ( Get(FileName) ; Get(LayoutName ))

                                 

                                malcolm