4 Replies Latest reply on Feb 27, 2016 5:18 AM by bigtom

    Popovers and New/Existing Record Scripting


      Hi -


      This is sort of an extension from (Create New 'Related' Record in Popover) but it has kind of transformed into a different question now after I have eventually made some progress.


      I have attached a database I have quickly developed as a theory test. It is a Customer table/layout where I can create a log of all communications between myself and them. (Customer Log)


      I have a set up at the moment where I have the following capability:

      1. Using Global Fields, I can create a new customer log record from a popover button.
      2. Using a button in the Customer Log portal, I can open that record in the same popover but on a different slide of a Slide Control object. Giving me 2 objects in the slide control ... 'New Log' and 'Existing Log'.


      Problems with my database:

      1. Clicking 'ADD TO LOG' button should automatically go to the 'New Log' object and display blank fields ready for data entry.
        1. By creating a script trigger when the button is clicked, it removes the ability to open the popover to show existing records on slide 2 as it will always open on the 1st slide.
      2. I want to be able to have a 'cancel' button on each slide to cancel or confirm changes / fields.
        1. Add Log: Save button validates the data and closes the popover. Fine
        2. Add Log: Cancel button gives a 'warning' - option 2 means data entry continues and option 1 means the popover is closed and record deleted.
        3. Add Log: Clicking off the popover (closing) - Again, if data has started to be entered it prompts a warning message to either continue entry or close and delete the record.
        4. Existing Log: Making changes to a number of fields can all be reverted by clicking a 'Cancel' button or clicking off the popover and confirming a warning dialog
        5. Existing Log: Data is only committed when the 'Save' button is clicked (no dialog) and the popover closes.


      My question is: How do I solve the above? Am I making life difficult for myself by merging 2 forms on popovers and slide control objects?

      How do I avoid conflicts with script triggers here and action scripts?


      Thank you in advance!

        • 1. Re: Popovers and New/Existing Record Scripting

          Unfortunately my FileMaker 13 computer is down. Have you consider using the hide field/object option for at least some of your need?

          • 2. Re: Popovers and New/Existing Record Scripting

            I mentioned this in your previous thread. The trigger needs to be on the popover and not the button.


            It would be easier to have separate popovers. view &edit records would happen directly from the existing log portal. Although getting it all in an Add/edit button can be done. But you would have to select the portal row to edit first any way. Why creat an extra step involving a button if it can be done directly.


            You ou can still use globals for adding logs with a save button if you have aN additional panel In the slide control. One slide for the global entry and one slide for the actual record entry via portal.

            • 3. Re: Popovers and New/Existing Record Scripting

              If the portal background color is transparent and not tied to the buttons doing it all in one popover is ok because at least the user will not wonder why when they click a button in the portal to edit something A popover connected to the add new button pops up.


              To directly answer you questions:


              1. Trigger on the popover not the button

              2. If you want to use save and cancel buttons you need an extra panel for globals.  Any form of cancel or closing popover runs a script to clear the globals. Saves move to the single row portal panel for data commit and then clear globals.

              • 4. Re: Popovers and New/Existing Record Scripting

                Many things will need object names.