2 Replies Latest reply on Apr 4, 2013 12:35 AM by JohnEriksson

    Perform search in a related table without leaving layout

    JohnEriksson

      Title

      Perform search in a related table without leaving layout

      Post

           Maybe my mind is burnt right now, but help me.

           I have a quite short list. In this list there is a portal showing related records. The portal has two columns, error code and description. (and a hidden column with the ID so it can hold which records that are related).

           So, my mission now is to write a script that has a parameter. If this parameter exists in this portal in the error code column, the script should return the description. Without leaving the layout. (there is a webviewer in the current layout that will be resetted if I secretly leave the layout and comes back.)

           help?

        • 1. Re: Perform search in a related table without leaving layout
          philmodjunk

               The web viewer resets if you use Freeze Window?

               You can set up a relationship between a field in the layout's table and the portal's that matches that field to the portal's error code field. Your script can then set this field to the script parameter and check to see if it matches to any record in the portal's table.

               LayoutTableOccurrence::SelectedErrorCode = PortalTable|Errorcode::ErrorCode

               Your script:

               Set Field [LayoutTableOccurrence::SelectedErrorCode ; Get ( ScriptParameter ) ]
               If [ Not IsEmpty ( PortalTable|ErrorCode::ErrorCode ) // error code exists in portal's table ]

               Replace "LayoutTableOccurrence" with the name shown in Layout Setup | Show Records from for your layout. Replace PortalTable|Errorcode with the name of a new Tutorial: What are Table Occurrences? of the portal's table that matches by Errocode.

          • 2. Re: Perform search in a related table without leaving layout
            JohnEriksson

                 Freeze window did not work. I found a way to not having a reset being an issue, but your suggestion is great. Will save it. Thanks!