How to stop restoring Find criteria?

Discussion created by DEC on Sep 11, 2014
Latest reply on Sep 14, 2014 by DEC

Hi Everybody,


I'm running into a strange anomaly. When the user conducts a find from within a found set, on occasion the find is conducted only within the limited range of records within the found set in existence at the time the new Find is executed.


For example, if I perform a find for Project A, and it returns a single record, and from there I hit the button to Find Contracts, and fulfill the Contract Type field with "Finance," instead of bringing me back ALL records that reflect "Finance" in the Contract Type field, it will return to me only those contracts that reflect "Finance" in the Contract Type field and "Project A" in the Project Name field.


The script is below. The script is complicated by the fact that the Find function implements a new window to conduct the Find, but I can't see whether that makes a difference.


The funny part is that sometimes the script seems to work properly, and sometimes it doesn't.


Any thoughts?


Thanks in advance for your help!






Set Error Capture [ On ]
Allow User Abort [ Off ]
Select Window [ Name: "Find"; Current file ]

If [ Get ( LastError ) 112 ]

Close Window [ Name: "Find"; Current file ]

End If

Set Variable [ $MainWindowName; Value:Get ( WindowName ) ]

Set Variable [ $MainWindowWidth; Value:Get ( WindowWidth ) ] Set Variable [ $MainWindowHeight; Value:Get ( WindowHeight ) ]

Set Variable [ $ScreenWidth; Value:Get ( ScreenWidth ) ]

GotoField[ ]

[ Select/perform ]
New Window [ Name: "Find"; Height: $MainWindowHeight; Left: $MainWindowWidth + 70; Style: Document; Close: “Yes”; Minimize:

“Yes”; Maximize: “Yes”; Zoom Control Area: “Yes”; Resize: “Yes” ]

Move/Resize Window [ Name: $MainWindowName; Current file; Top: 0; Left: Case ( Get ( WindowDesktopWidth ) > 2000 ; 50 ; 0 ) ]

Select Window [ Name: "Find"; Current file ]

Go to Layout [ “FindAgreements_PopUp_New” (Contracts) ]

Select Window [ Name: "Find"; Current file ]

Adjust Window

[ Resize to Fit ]

Move/Resize Window [ Name: "Find"; Current file; Height: $MainWindowHeight ]

Show All Records

Enter Find Mode [ ]

GotoField[ ]
Select/perform ]

Pause/Resume Script [ Indefinitely ]
Go to Layout [ “FoundContracts_ListView_New” (Contracts) ]

Perform Find [ ]
If [ Get ( FoundCount ) = 0 ]

Show Custom Dialog [ Message: "No records were found using the designated search criteria."; Default Button: “OK”, Commit: “Yes” ]

Perform Script [ “Close Find Pop Up” ]


Close Window [ Name: $MainWindowName; Current file ]

Select Window [ Name: "Find"; Current file ]

Move/Resize Window [ Current Window; Height: $MainWindowHeight; Width: $MainWindowWidth; Left: ($ScreenWidth/2) - ($MainWindowWidth/2) ]

Set Window Title [ Of Window: "Find"; Current file; New Title: $MainWindowName ]

Go to Layout [ “FoundContracts_ListView_New” (Contracts) ]

Sort Records [ Keep records in sorted order; Specified Sort Order: Projects::d_ProjectTitle; ascending Contracts::d_Contract_Type; based on value list: “Contract Type” Contracts::d_ContractDescription; ascending
Contracts::d_OpposingParties; ascending ]

[ Restore; No dialog ]

Go to Record/Request/Page

[ First ]

End If