11 Replies Latest reply on Dec 5, 2012 8:43 AM by philmodjunk

    Scrolling merge fields?

    EP

      Title

      Scrolling merge fields?

      Post

           I have a database of contacts.  I have one layout with the contacts information displayed via merge fields.  If a user want to make changes, they click an "edit contact" button and are taken to a layout with actual fields that they can edit.  I also have a portal that contains a "notes" field.  Notes are added to the portal each time the contact is contacted.  Is there a way I can make the notes field in the portal a merge field (to prevent editing) but make it scrollable?  Sometimes long notes are typed into the field and we need to scroll.  Also, can I make a window pop up to add new notes, since the portal will now contain merge fields only? Thanks,

        • 1. Re: Scrolling merge fields?
          philmodjunk

               I suggest defining a calculation field that simply references the Notes field as its sole calculation term. Then you can place this calculation field on your portal row and format it with a scroll bar.

               You can see an example of this method on the first layout of the Known Bugs List database. The release notes shown in the portal have a scroll bar but are not modifiable due to my using such a calculation field.

          • 2. Re: Scrolling merge fields?
            EP

                 Makes sense. Thanks Phil.  So I would just use a popup window to add new notes to the portal?

            • 3. Re: Scrolling merge fields?
              philmodjunk

                   That is one option and the one I normally use. You can use either the New Window script step or Show Custom Dialog with the notes field specified as the input field. (New window requires more scripting--especially on windows platforms, but makes it possible to give the user a nicer layout for entering/editing the data.)

              • 4. Re: Scrolling merge fields?
                EP

                     I just got this working with the Show Custom Dialog window.  I see what you are saying.  It only provides 1 line to type into.  If there is no way to make the input field larger, I will have to use a New Window script.  Any links/tutorials/script examples to get me started?  Thanks

                • 5. Re: Scrolling merge fields?
                  philmodjunk

                       Remember that Known Bugs List database? There's a link in my first post to download it from Drop Box. It has code such as that used with the "edit" button on the first layout that does exactly what we are discussion, it opens a new window for the user to use to edit the text field in the portal. It has a large text field and a portal for listing associated bug report records, so it gives you an idea as to the new interface options New Window produces that aren't possible with a custom dialog.

                       The nasty detail you have to manage with New Window is if you have designed your database on Windows to have maximized windows. Opening a new window drops the windows out of their maximized state and the original window will snap to whatever size it last had when it was not maximized--which could be completely wrong for that window. The added code in the script checks to see if this is a windows system and if so, it resizes the orginal window back out to the largest dimensions possible for a window that isn't maximized and the scripts that close this pop up window then restore the original window to its maximized state after closing the pop up.

                  • 6. Re: Scrolling merge fields?
                    EP

                         Will check this out.  I'm using multiple platforms: win 7, Mac, FMGO.  Wish I could get it done with the dialog windows, but I may as well learn because I'm going to make all fields calculations and merge fields in each record, with "edit" buttons that pop up a wndow with groups of field to be edited.  Thanks.

                    • 7. Re: Scrolling merge fields?
                      philmodjunk

                           Check on how New Window works in FM GO. At one time, I was told that New Window can't be used like this in FMGO, that it produced a new window that completely covered the screen. Don't know if this is still the case.

                      • 8. Re: Scrolling merge fields?
                        EP

                             Phil, getting back to the first question of a scrollable merge field......I implemented the calc field.  Is there any way to add a custom message when users try to edit a note, perhaps "Notes cannot be edited once they are entered. Please add a new note."

                        • 9. Re: Scrolling merge fields?
                          EP

                                

                               "Check on how New Window works in FM GO. At one time, I was told that New Window can't be used like this in FMGO, that it produced a new window that completely covered the screen. Don't know if this is still the case."
                                
                               This is exactly what is happening.  Is there any way to alter the custom dialog windows.  Perhaps make the input fields larger?
                                
                          • 10. Re: Scrolling merge fields?
                            philmodjunk

                                 You cannot alter the format of custom dialogs. If that were possible, I'd use them a lot more and New Window a lot less. wink

                                 I think that in FMGO, you'll need to work in terms of a layout change rather than a pop up dialog box. Tapping the edit button takes the user to a layout where editing is possible, tapping a button on the edit layout then returns them to the original layout...

                            • 11. Re: Scrolling merge fields?
                              philmodjunk

                                   Just had an interesting idea that might serve for both FM GO and FileMaker Pro clients (Don't know if it will work in IWP).

                                   Put an invisible tab control on your layout with two panels. One shows the calculation field, one shows the text field. Give each panel an object name using the name box in the Inspector.

                                   Then a script can toggle between the "locked" and "unlocked" forms by using Go To Object to select the appropriate panel in the tab control. The Locked panel would be your default panel so that the field is always locked when you first access the layout or change records.

                                   Hmmm, but now I have to consider the fact that your field is inside a portal and realize that while this idea may work in other layouts, it won't work from within a portal row as you can't place tab controls inside a portal row...frown