7 Replies Latest reply on Feb 2, 2015 5:26 AM by DanielJenkins

    Main Menu?

    DanielJenkins

      Title

      Main Menu?

      Post

      How do I create a form that I can use as a main menu for my database?

      Also, on my customer form, how do I create a button that directs me to the booking form? I want it to direct me to a new form but automatically input the customer ID number of the current record I was using when I pressed the button?

      Thanks, Daniel.

        • 1. Re: Main Menu?
          TKnTexas

          Your MAIN MENU form is a layout of buttons tied to scripts.  It can be on any table.  Have a script that is set up to go to the Main Menu layout, CMD (CTRL) - 1

          • 2. Re: Main Menu?
            philmodjunk

            Create a new layout and call it "Main Menu".

            This can be based on any table in your system--even a "no data" table specifically set up for such type layouts.

            Set up a button to perform a script:

            Set Variable [$$CustID ; value: YourLayoutTable::CustomerID ]
            Go To Layout ["Booking" (BookingTable) ]
            #What happens next is up to you

            At that point, your script could find a a record or records with the customer ID. It could create a new record and assign the value of $$CustID to a field of that new table. It could do nothing more, but scripts on the Booking layout can access this global field as needed and a field in the Booking table can use an auto-enter calculation to enter this value into any new record created on it.

            A completely different approach is for your button to use Go TO related Records to pull up all records with that Customer ID. This assumes two things: That you have a relationship in place that matches records to the Bookings table by Customer ID and that there is at least one such related record to "go to".

            • 3. Re: Main Menu?
              DanielJenkins

              When i try that script for the button it tells me I need an operator where value is onwards.
              I got it working where it directs me to bookings with the same customer ID,
              But what I want it to do is:
              If I am viewing a Customer Form where the Customer ID is "0010" and I click this button (New Booking) it directs me to a New booking record where the Customer ID "0010" of the form I was viewing when I clicked the button is entered automatically into this new booking record.
               

              thanks, Dan
               

               

              • 4. Re: Main Menu?
                bigtom

                It is in there. $$CustID.

                You need to have a script step after changing layouts to set the customer ID on the new layout with the Booking table I assume. You should hopefully have these tables related by customer ID.

                 

                Set Variable [$$CustID ; value: YourLayoutTable::CustomerID ]

                Go To Layout ["Booking" (BookingTable) ]

                Set Field [ BookingTable::CustomerID; $$CustID]

                Commit Records/Requests

                 

                This is essentially carrying your Customer ID via script to the new layout and putting it where it needs to be.

                • 5. Re: Main Menu?
                  TKnTexas

                  I think there needs to be a NEW RECORD step after the Go To Layout step

                  • 6. Re: Main Menu?
                    bigtom

                    I think there needs to be a NEW RECORD step after the Go To Layout step

                    Yes, I was just trying to illustrate how the ID moved. It was a bad example.

                     

                    Set Variable [$$CustID ; value: YourLayoutTable::CustomerID ]

                    Go To Layout ["Booking" (BookingTable) ]

                    New Record / Request

                    Set Field [ BookingTable::CustomerID; $$CustID]

                    Commit Records/Requests

                    • 7. Re: Main Menu?
                      DanielJenkins

                      Thanks for the help, it is much appreciated.
                      It seems I was missing the Set Field part :-)