Announcement

Collapse
No announcement yet.

Keep advanced filter on grid after a record is updated by a form

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Keep advanced filter on grid after a record is updated by a form

    I have a grid with an application link to a form to add and update records of this grid. After I set a filter on the grid with the Adanced Search the filtered set of records is shown in the grid. Which is OK of course. When I click on the application link in a record of this grid, a form will show up with the record details and I can make changes to the record. So far so good. But when I click on save then I am navigated back to the grid and the filter is gone. The full set of records is shown again. Is there an option to keep the advanced filter till I click on reset or something?

    Regards,

    Marcel Besteman
    Netherlands

  • #2
    I never use Advanced Search. But I use Quick Search, and I set the application link properties for editing to be shown in Modal. When I click Save button to update the records, the modal closes, and the grid stays with the filtered data.

    Comment


    • #3
      Hi Anjellz,

      Thank you for responding on my question. Opening the linked form in model is a workaround but is not working for me. The form does contain a lot of information (fields) I want to show. Modal is not automatically scaling. I really want to solve this using the link option "Open in same window". Now there is something important I have discovered: if you set the navigation option of the link form to Exit Application = No (Application -> Navigation) then the form will not close automatically if you edit the record and click Save. But if you click on Back after you edit and saved the record it will go back to your grid with the correct filtered set of records! The back site of this is that you need to press an additional button (back) on the linked form and when you insert a new record it will not go back automatically to the grid but it goes to a new blank record in the linked form. So I tried a second work around: I have set a sc_redir to the grid at event onValidateSuccess. But that redir causes that the record (edit or insert) will not be saved in the database! So my conclusions so far:

      When you use a linked form in a grid and apply a advanced search filter:
      1. The navigation setting Exit Application = Yes will reset the filter when you exit the linked form and go back to your grid again.
      2. Using the sc_redir macro at events onValidateSuccess, onAfterUpdate and onAfterInsert will cause that your record will not be saved in the database.

      Is there anybody who has thoughts or additional workarounds on this?

      Regards,

      Marcel Besteman
      Netherlands

      Comment


      • #4
        Ok, I found myself a workaround:

        If you set the navigation option of the linked application (under Application->Navigation) to Exit Application = Yes it will reset the filter of the grid when you come back (I don't know why, but it does). So leave that option to No and put the following code onAfterUpdate and onAfterInsert of your linked form:

        sc_commit_trans();

        sc_redir('<grid_name>');

        This sc_commit_trans() is key! Otherwise your record will not be save when the code executes the redir.

        Regards,

        Marcel Besteman
        Netherlands

        Comment

        Working...
        X