6 Replies Latest reply on Oct 17, 2013 8:45 AM by ArtL

    Turning off Button Once selected

    ArtL

      Title

      Turning off Button Once selected

      Post

           I did a search and have not quite found the same issue as mine, but close, so I will post this one up.

           I have a Course Selection program that selects 6 Different Divisions for training, each with their own sequential serial number.

           What seperates them is the Code for the Division, the numbers can be the same.  Eg.

           ABC 123

           XYZ 123

           The Admin selects the CODE and only when he saves the course outline, is the serial number applied in Auto-Serial in sequential order for each of a set number of CODES (6).

            

           Here is my problem.

           Once the SAVE button is pressed the button to SAVE disappears, I have Change to Hand Cursor Unchecked... but if you press where the button is, it continues to advance the Serial number.

           I have tried a couple of solutions, including Valuecount.  Can't stop the clicking on the Greyed Out button from advancing the counter.

           Once the SAVE button is checked, the SAVE BUTTON should be permanently Disabled for this Layout.

           Let me know what other info you may need to shed more light.

            

           Thanks! 

        • 1. Re: Turning off Button Once selected
          philmodjunk

               This sounds related to a post that I responded to earlier today. If it was, it's better to use Post a new Answer to continue to respond back to the same issue. That way, we have a complete picture of the issue and a history of all that has been suggested so far.

               As I posted in that other thread, changing the appearance of the button does not alter its function. Either the script has to use an If step to keep anything from happening when the button is "disabled" or you have to completely hide the button from the user. That can be done with an invisible tab control or a portal in some cases, but if this a button inside of a portal as I saw in that earlier post, then it's better to set the button's script to not do anything when the button is supposed to be "diabled".

               Please post two things:

                 
          1.           The conditional format expression that you used to make the button disappear.
          2.      
          3.           Your script. (But only if you tried to follow my advice with an If step and it didn't work for you.)
                       

               To post a script to the forum:

                 
          1.           You can upload a screen shot of your script by using the Upload an Image controls located just below Post A Answer.
          2.      
          3.           You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here. (with this approach, you can get multiple script steps on the same line, please edit the pasted text by inserting some returns to separate those steps.)
          4.      
          5.           If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
          6.      
          7.           If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format.
          • 2. Re: Turning off Button Once selected
            ArtL

                 My apologies, I read an anwser and tried the solution to no avail but forgot to note the day and time of the post.  I will remember this for next time.

                 I did try an IF statement and I couldn't get it to work, most likely a sytax error on my part.  Give me a minute to grab the script I wrote without the failed attempts....

                  

            • 3. Re: Turning off Button Once selected
              ArtL

              If

              [ Courses::_CourseID_SelectID="ALL" ]

              Go to Layout

              [ “ALLserial#Gen” (ALLserial#Gen) ]

              New Record/Request

              Go to Field

              [ ALLserial#Gen::ALLSer# ]

              Select All

              Copy

              [ ALLserial#Gen::ALLSer# ]

              [ Select ]

              Go to Layout

              [ “Course Details” (Courses) ]

              Go to Field

              [ Courses::_ALL ]

              Paste

              [ Courses::_ALL ]

              [ Select ]

              Else

              If

              [ Courses::_CourseID_SelectID="ET" ]

              Go to Layout

              [ “ETserial#Gen” (ETserial#Gen) ]

              New Record/Request

              Go to Field

              [ ETserial#Gen::ETser# ]

              Select All

              Copy

              [ ETserial#Gen::ETser# ]

              [ Select ]

              Go to Layout

              [ “Course Details” (Courses) ]

              Go to Field

              [ Courses::_ET ]

              Paste

              [ Courses::_ET ]

              [ Select ]

              Else

              If

              [ Courses::_CourseID_SelectID="FAC" ]

              Go to Layout

              [ “FACserial#Gen” (FACserial#Gen) ]

              New Record/Request

              Go to Field

              [ FACserial#Gen::FACser# ]

              Select All

              Copy

              [ FACserial#Gen::FACser# ]

              [ Select ]

              Go to Layout

              [ “Course Details” (Courses) ]

              Go to Field

              [ Courses::_FAC ]

              Paste

              [ Courses::_FAC ]

              [ Select ]

              Else

              If

              [ Courses::_CourseID_SelectID="GSP" ]

              Go to Layout

              [ “GSPserial#Gen” (GSPserial#Gen) ]

              New Record/Request

              Go to Field

              [ GSPserial#Gen::GSPser# ]

              Select All

              Copy

              [ GSPserial#Gen::GSPser# ]

              [ Select ]

              Go to Layout

              [ “Course Details” (Courses) ]

              Go to Field

              [ Courses::_GSP ]

              Paste

              [ Courses::_GSP ]

              [ Select ]

              Else

              If

              [ Courses::_CourseID_SelectID="MEC" ]

              If

              [ Courses::_CourseID_SelectID="MEC" ]

              Go to Layout

              [ “MECserial#Gen” (MECserial#Gen) ]

              New Record/Request

              Go to Field

              [ MECserial#Gen::MECser# ]

              Select All

              Copy

              [ MECserial#Gen::MECser# ]

              [ Select ]

              Go to Layout

              [ “Course Details” (Courses) ]

              Go to Field

              [ Courses::_MEC ]

              Paste

              [ Courses::_MEC ]

              [ Select ]

              Else

              If

              [ Courses::_CourseID_SelectID="STK" ]

              Go to Layout

              [ “STKserial#Gen” (STKserial#Gen) ]

              New Record/Request

              Go to Field

              [ STKserial#Gen::STKser# ]

              Select All

              Copy

              [ STKserial#Gen::STKser# ]

              [ Select ]

              Go to Layout

              [ “Course Details” (Courses) ]

              Go to Field

              [ Courses::_STK ]

              Paste

              [ Courses::_STK ]

              [ Select ]

              End If

              End If

              End If

              End If

              End If

              End If

              If

              [ Courses::Committed="" ]

              Set Field

              [ Courses::Committed ; 1 ]

              Commit Records/Requests

              [ Skip data entry validation; No dialog ]

              Else

              Halt Script

              End If

                    =============================================== End of Scipt, Excerpt below============

                    

              If

                    

              [ Courses::Committed="" ]

              Set Field

                    

              [ Courses::Committed ; 1 ]   <<-------------------------------------------------------------Button Disappears here!

              Commit Records/Requests

              [ Skip data entry validation; No dialog ]

              Else

              Halt Script

              • 4. Re: Turning off Button Once selected
                ArtL

                     Phil,

                      

                     I resolved it!

                      

                     Just figuring out a way to post it!  I think just asking you a question makes me smarter!

                      

                     Thanks

                      

                • 5. Re: Turning off Button Once selected
                  ArtL

                       Right under my nose....

                        

                  If

                  [ Courses::Committed=1 ]

                  Halt Script

                  Else

                        

                       This seems to work fine.  Testing it this morning.

                        

                  • 6. Re: Turning off Button Once selected
                    ArtL

                         After Testing the Script in the post directly above DID NOT WORK.

                         I tried another approach that has tested out to work just fine!

                          

                         If GetAsNumber (Courses::CourseID)>0

                         Exit Script

                         Else

                          

                         The course ID, once fixed will be a combination of text and a number always greater than 1. If the field is not fixed, it will only return text!

                         Perfect