April 14, 20169 yr I am using the MasterDetail layout from Todd Geist in a couple of places in our database. By default this layout loads the first 2000 records into the MasterDetail portal. In order to save time and bandwidth I've added some logic to perform a find for only active records on the first navigation to the layout. This OnLayoutEnter behavior is only done for the first navigation to the layout, because I don't want it to interfere with any found sets the user may have isolated on subsequent navigations. I've also added an OnModeEnter script trigger to detect entry into Browse Mode, which successfully squelches this auto-find behavior in the event a user navigates to the layout in find mode, and then performs a find. The logic looks similar to this: Quote set variable $trigger = value passed in from relevant script trigger calls If ( $trigger = "OnModeEnter" and Get ( WindowMode ) = 0 ) set variable $add_layout_to_list ; True else if ( $trigger = "OnLayoutEnter" and not ( Position ( $$first_navigation_find ; Get ( LayoutTableName ) ; 1 ; 1 ) ) perform find on active field for table set variable $add_layout_to_list ; True end if if $add_layout_to_list set var $$first_navigation_find ; If ( not IsEmpty ( $$first_navigation_find ) ; $$first_navigation_find & "pilcrow" ) & Get ( LayoutTableName) end if So far so good. This works okay. The remaining issue, however, is that our users sometimes want to make snapshot links to these layouts. Unfortunately I don't know how to detect the layout is opening for the first time in a session from a snapshot link. As a result, the auto-find overrides the snapshot link found set. Is there any way around this? A way to detect opening from a snapshot link, or perhaps some superior logic to approaching what I'm trying to do here that isn't prone to this problem?
Create an account or sign in to comment