2 Replies Latest reply on Oct 12, 2014 9:45 AM by Garryt

    Passing a position from one layout to another


      OK, I have a 5 tab layout called ViewOnly used for just display of fields. Call the tabs left to right, Details, Contacts, Documents (has portal), Images (has portal), WebViewer. These work fine. I achieved this by simply using the Inspector and disabling "Enter in Browse Mode" for all objects on all tabs on this ViewOnly layout.


      I took this layout and duplicated it. The dupe layout I named "Add_Edit" and set all fields on all tabs with the Inspector to "Enter in Browse Mode" = On. I call this in with a short script so I can prepare the user for either adding a new record or editting what they clicked on.


      Here's the deal. When the user edits something on ViewOnly:tab:Documents I shift him over to Add_Edit:tab:Documents let him input and commit, I want the user to land on ViewOnly:tab:Documents and not ViewOnly:tab:Details. What it's doing is always going back to the first left hand tab. I was looking for a Get() to get the value of the tab on ViewOnly to put in a $variable which I can refer to then directing back to the tab that they left before editting is called. But there isn't a specific Get(ObjectPosition) that I can find.


      Is this a custom function to build? What's the technique to use to record the field_on_this_tab where the user just left so I can bring him back to that spot?


      Thanks for any advice.



        • 1. Re: Passing a position from one layout to another

          The key to navigating back to specific tabs or to specific instances of fields is to give each of these specific things their own object name.  That's the "Name" in the Position tab of the Inspector when that object is selected.


          Once you do that you can use the script step Go To Object[] and give that particular name.  You might go to a specific tab or to a specific field on a tab.  If you go to the field, the tab that it is on will be brought forward automatically.


          You might find it helpful in your scripting to use functions like



          GetLayoutObjectAttribute() if you are getting info about a specific object.


          In particular you might find GetLayoutObjectAttribute("tab01name"; "isFrontTabPanel") useful for learning if the tab panel with the object name "tab01name" is the active one.




          • 2. Re: Passing a position from one layout to another

            Another option...


            If you are using FileMaker 13, you may want to consider using a pop-over for the editing of data fields.


            You can iether populate the pop-over with the native fields allowing them to be edited, or use globals, which you can populate then write them to the original fields. This gives you the opportunity to cancel any edit, even if you have clicked out of a field and commited the record.


            You can also build in a modicum of security into the popover, if you use a script to activate the pop-over.