8 Replies Latest reply on May 8, 2014 10:25 AM by RickRobbins

    Refreshing a list layout

    RickRobbins

      Title

      Refreshing a list layout

      Post

           I have been struggling for the last day on a problem that I cannot resolve.

           I have two tables:  Customer and Customer Documents.  I have a form layout for Customer and a list layout for Customer Documents (not editable) and a form layout to add/edit Customer Documents.  Customer Documents has a foreign key Customer ID.  

           On my form layout for Customer, I have a button which runs a script to open a new window showing a list of documents for that customer (Customer Documents) using get related record.  Once on the customer documents list, a user can add a document. This is through a button that opens a modal window allowing the user to fill in the fields and then commit or cancel.  Both options close the modal window.

           When the user commits the record and the modal window is closed, the list windows which comes back into focus is not updated with the new record in the Customer Documents table.  Is there a way that I can have the list updated?

           Thanks for any help.

           Rick

        • 1. Re: Refreshing a list layout
          philmcgeehan

               Have you tried a
                     Refresh Window [ Flush cached join results ]
               script step, after the close window step?

          • 2. Re: Refreshing a list layout
            RickRobbins

                 Yes and unfortunately it didn't work.

            • 3. Re: Refreshing a list layout
              philmodjunk

                   What you are looking at is a found set of records in your list view. Adding a new record will not automatically change what records are present in that found set. Perform a find or use Go To Related Records to update the found set as part of a script performed when the user finishes creating the new records such as when they click the button to commit.

                   Another option would be to use a portal to list the records. The list of related records in the portal should update automatically when a new record is added.

              • 4. Re: Refreshing a list layout
                RickRobbins

                     Yes, I understand that I am looking at a found set of records.  I just tried your suggestion of using Go To Related Records. I added this step to the commit button on the modal window but to the found set was not updated.  I also tried a refresh after the Go To Related Records but this also didn't work.  I would prefer not to have to use a portal if possible.  Any idea what I am doing wrong?

                • 5. Re: Refreshing a list layout
                  philmodjunk

                       I would guess that your GTRR step was either not set up correctly, was performed from the wrong context or there isn't the right relationship in place to produce the results that you need.

                       The GTRR would need to be performed from a specific layout (one based on the correct table occurrence needed for your relationship to the table on which your layout listing the records is listed and should be performed in the window where you have listed these records.

                       So if you have this relationship:

                       Table1------<Table2

                       Where Table 2 stores the records being listed, the script might look something like this:

                       Select Window [//select the window used to list the records]
                       Freeze Window
                       Go To Related Record [Show only related records; From table: Table1; Using layout: "Table1" (Table1)  ]
                       Go To Related Record [Show only related records; From table: Table2; Using layout: "Table2" (Table2)  ]

                       The first GTRR sets up the needed "context" in order for the second GTRR to correctly pull up the original list of records plus your newly added record.

                  • 6. Re: Refreshing a list layout
                    RickRobbins

                         Thanks for the idea.  I just tried something else that seems to work and is easier than what you mentioned. 

                         When the commit button on the modal window is pressed, the script commits the record, closes the window , and then I added:

                         Find Matching Records (Extend; "using my foreign key"). 

                         When I tested it, it worked.  Do you think this is good way to solve this or are there "hidden" issues that I may not see right now?

                    • 7. Re: Refreshing a list layout
                      philmodjunk

                           There are no hidden issues that I know of and it's a much simpler option.

                      • 8. Re: Refreshing a list layout
                        RickRobbins

                             Thanks for the super quick response!!!!!