3 Replies Latest reply on Jun 22, 2016 1:28 PM by tays01s

    Custom dialogue: Value?

    tays01s

      I have an 'OnPanelSwitch' trigger to stay on a certain tab is 2 values aren't given:

      Commit Records/Requests [ No dialog ]

      Show Custom Dialog [ Title: "Complete Calc info"; Message: "You must complete critical fields before leaving this tab:"&¶ & If(IsEmpty(Calc::cm);"cm";"") &¶ &
      If(IsEmpty(Calc::kg);"kg";""); Default Button: “Complete tab”, Commit: “Yes”; Button 2: “Switch tab”, Commit: “Yes” ]

      Exit Script [ Result: "Switch tab" ]
      If [ GetValue ( Get ( TriggerCurrentPanel );2 ) ="tab_calcs" and

      ( IsEmpty(Calc_n::cm) or IsEmpty(Calc_n::kg) )]

      End If

       

      Because the user could get stuck on this tab when they've not complete vital info elsewhere, I'd like them to have the option of overriding with a 'Switch tab' in the Custom dialogue. However, this does appear to be capable of Exiting the script, so the 'If' lines of the script come into play.

       

      Can I use Custom Dialogue to set the value of 'Exit Script'?

        • 1. Re: Custom dialogue: Value?
          bigtom

          You can use Let()  anywhere you have access to the calc engine and set the value of Exit Script result to $result and use it later in the script to send the user specific places via script.

          • 2. Re: Custom dialogue: Value?
            BruceRobertson

            Instructions for using custom dialogs are here:

            FileMaker Pro 15 Help

             

            In particular, read the section 

            Use the Get(LastMessageChoice) function to determine which button the user presses.

             

            Please tell us what you understand about how to use the get(lastMessageChoice).

            • 3. Re: Custom dialogue: Value?
              tays01s

              Thank you both. As suggested the Get (LastMessageChoice) sorted the Exit (see below). The problem is that the OnPanelSwitch trigger when applied to my tab_calcs, also gets applied to other tabs. Is there a way around this? Or, as Beverley suggested in a different post, is it better to dump tabs and use other objects (though this would create quite a lot of short term grief I have to say!).

               

              Commit Records/Requests [ No dialog ]

              If [ ( IsEmpty(Calc_n::cm) or IsEmpty(Calc_n::kg) )]

              Show Custom Dialog [ Title: "Complete Calc info"; Message: "You should complete critical fields before leaving this tab:"&¶ & If(IsEmpty(Calc::cm);"cm";"") &¶ &
              If(IsEmpty(Calc::kg);"kg";""); Default Button: “Complete”, Commit: “Yes”; Button 2: “Switch tab”, Commit: “Yes” ]

              Exit Script [ Result: Get ( LastMessageChoice ) = 2 ]

              End If

              If [ GetValue ( Get ( TriggerCurrentPanel );2 ) ="tab_calcs" and ( IsEmpty(Calc_n::cm) or IsEmpty(Calc_n::kg) )]

              End If