6 Replies Latest reply on Feb 23, 2012 6:47 PM by dinora

    Auto update

    dinora

      Title

      Auto update

      Post

      I  have a global field on a table that allows me to display an alphabet via a value list.

      Then I have a  portal to display the names of travel agencies.

      So I have created an index

      Global field displays the aphabet, and as I click on the alphabet letter the portal displays the names of travel agencies, begining with A, B, C etc

      The above I did by adding a script.

      Then a second script allows me to display the related information on the layout as I click on the portal row - 

      If the alphabet letter does not result into anything a custom dialog tells me to make another alphabet selection.

      If I click on an alphabet letter that produces no results, a custom dialog tells me to make another selection

      And when I do, the layout information remains as to the last record I was in.  Until I click on the portal row .  Is there anyway to make this process more flawless.

      i.e. If I hit an alphabet letter that does not result into anything then the layout information blanks out, to indicate that nothing was found

      Thanks

      Dinora

       

        • 1. Re: Auto update
          philmodjunk

          Is this the "master detail" portal of an ealier thread that you posted?

          Are the fields you want to be blank fields in this "detail" portal?

          If so, your script that displays the dialog that no records starting with that letter exist should be able to set the field or variable that controls what records show in the portal to a value that will not permit any records to show in the detail portal. That could be as simple as clearing its value by setting it to "".

          • 2. Re: Auto update
            dinora

            Hi Phil,

            Sorry to hear you were not around the forum yesterday -  Hope all is well.

            No this post does not relate to my previous one. This is completely different, this is for another database I have.

            This is not between two portals - Basically I have a portal that comes from a global field Alphabet that allows me to browse up and down the alphabet displaying travel agencies in alpha order. On the right of the screen I am actually on the travel agency layout so no need for a portal. This screens updates as I highlight the record on the main menu.

            This alls work so far.  But I have two problems

            1.- When I create a new record it does not display the blank record layout, but it creates a record that I have to navigate to.

            2.- When I click on an alphabet letter that does not produce any results I would like the screen on the right to update to show that there are no records found for my find command.

            Thanks

            Dinora

             

            • 3. Re: Auto update
              philmodjunk

              This appears to be a portal based on a self join--a relationship between two occurrences of the same table.

              If you can describe the current steps for 1, It will help me suggest a method for doing what you want. Do you click a button to start a new record? Do you create the new record on the layout or inside the portal?

              2. Sounds like you are using Go To Related Records to pull up the records with the same starting letter. If there are no related records, the found set will not update with Go to Related records, unless you can specify <Current Layout> instead of specfically naming the layout. (Weird by true and a legacy of simpler days when GTRR with no related records always produced an empty found set...)

              You could also perform a find for the specified records with set error capture enabled. Then, a find that cannot pull up any records will produce an empty found set.

              WIth either a performed find or Go to related records, your script can detect this condition and display a message in a custom dialog telling the user that there are no records. You can even use a conditional format on the button to grey out the button label text to make it look disabled.

              • 4. Re: Auto update
                dinora

                Hi Phil,

                Here I go,

                This appears to be a portal based on a self join--a relationship between two occurrences of the same table.

                Answer: You are correct tihs is relation between two occurences in the same table.

                If you can describe the current steps for 1, It will help me suggest a method for doing what you want. Do you click a button to start a new record? Do you create the new record on the layout or inside the portal? I will describe below.  When I create a new record I am just clicking a button inside the layout not the portal.

                I have a global field lets calle it G_Alphabet related to a Alphabet A_Z which is a calculation field.

                I have partially solved my problem as I took out the script on this the g_alphabet as it was putting me on a loop thus my problem with creating records.  So I took the script out and all seems to work.

                I did  enter a custom dialog to say that there are no records for the option selceted - However user must click outside of the portal to update otherwise the custom dialog does not display all the time.

                I will explain

                If A results in travel agencies with A then B the same

                We get to C and no travel agencies with C name. I get the custom dialog to make another selection, but if I make another selection without clicking outside of the portal it seems the custom dialog will not show up again.

                However if I make it update by clicking outside the portal then the custom dialog will show up.

                Any suggestions?

                By the way, thank you for your help on the Portals, It worked.

                • 5. Re: Auto update
                  philmodjunk

                  On item 1, what is the relationship and portal filter used that controls what records appear in the portal?

                  When first created, the fields of the table are blank until data is entered into them by you or via auto-enter settings or a script. Then the data needs to be committed before it can appear in the portal. The presence of a filter on the portal can further cause a problem where  you need to either use a script to force the filtered portal to update to show the new record. I need to see the relationship and portal filter expressions used before I can make a detailed suggestion.

                  Item 2

                  Clicking outside the portal commits the record.

                  Try adding a commit record step to your script to take the place of clicking the layout background.

                  • 6. Re: Auto update
                    dinora

                    Thanks -  I got it now. The commit record step did it.