I have a complicated issue:
using the quick find in FM I want to display the results of the research as multilines in a grid (like Google).
Is the reports can help me here to display the results?
thanks for the hints
Whether performing a find or a quick find, with scripting, you can display the resulting found set of records in a list or view where individual records can then be clicked to bring up a form view layout of the selected record if you do so via scripting rather than manually.
Define a text field with global Storage: gSearchText
Run this script:
Perform Quick Find [ YourTable::gSearchText ]If [ Get ( FoundCount ) > 1 //multiple records were found ] Go To Layout ["List View"]Else #Do nothing or.: Go to Layout ["Form View"]End If
"List View" and "Form View" would be layouts based on the same table that you are searching, but you configure one layout to support a list view of all your found records and the other is configured for Form View where you gert a detailed view of the selected record. On the list view layout, you can either use Button Setup... to change all the fields in your list view into a single button or you can add a button to the body of the layout that perform this single script step:
Go To Layout ["Form View"]
And then you can select a record for viewing/editing from your list of found records with a single mouse click.
I'm confused by quick find results:
I created a list view layout and I put a field "GlobalSearch" on the header. my main idea is to have a search field (as google) on the same page as the result, and when no resul found it shouldn't list any records.
So When I click on search button that i created I run this script 'see attach).
the pbm is the first time i run the script Get ( FoundCount ) return good result (e.g: 1 if i have one record)
the second time if I should not have a record found, the Get ( FoundCount ) retrun also 1 (cause the old retrieve is =1), therefore i have the old result displayed!
how can i reset the display in the list if i don't have any record as result in my current quick find?
hope i was clear
thx in advance
in fact i run the debugger and i saw that when the second time the system execute the Perform Quick Find[$$globalsearch] immediately the result (one record) is displayed on the screen, so of course the foundcount will retrieve 1 record.
so the issue why the Perform Quick Find[$$globalsearch] is returning an old value as result, although i checked the variable $$globalsearch, it takes the new value.
Why do you enter find mode after the custom dialog box pops up to say "no result found"?
It appears that the found set is not changed if no records are found--unlike a standard scripted find with set errror capture enabled.
Try this code instead:
Perform Quick Find [ YourTable::gSearchText ]If [Get ( LastError ) > 0 // no records found] #Use next to steps to create empty found set only if you want to... Show All Records Show Omitted only Show Custom dialog ["no records match this criteria..."] Else If [ Get ( FoundCount ) > 1 //multiple records were found ] Go To Layout ["List View"] Else #Do nothing or.: Go to Layout ["Form View"] End If
no infortunaltely it doesn't work.
I used Get ( LastError ), it retrun 0 after the Perform Quick Find while i should have not zero, cause i'm searching something that doesn't exist in the database.
>>Why do you enter find mode after the custom dialog box pops up to say "no result found"?
I'm using this to clean the page from the previous result; that is my main problem.
fot that reason also, i trigger on page load the script : enter find mode on order to clean the page and it works. but the pbm is whenever i perform quick find ($$globalsearch) statement with a value that doesn't exist, the page return 1 record, also the same record !
i don't know if i'm doing right :(
I don't recommend entering find mode for this purpose. Instead, manipulate the found set to produce zero records.
Here are two options for that:
Show All RecordsShow Omitted only
Enter Find modeSet Field [YourTable::SomeField ; "ImpossibleValue"]Set Error capture [on]Perform FInd
The first option is simplest but can fail in shared databases where one user might create a new record at the same time this script executes and that can pop up that new record when you don't want it to. The second option requires specifying search criteria guaranteed to not to match any record. I usually search for a negative number in an auto-entered serial number to do this.
I just ran a quick test and that tells me you need to doublecheck your script.
When I run this script:
Perform Quick Find ["xxxxxxxxx"]Show Custom Dialog [ Get ( LastError )]
I get both the same dialog "no records match..." that I do with performing a standard find and the same error code: 401 is returned.
You may want to post your script here if you'd like others to see if they can spot what's not quite right in your script:
To post a script to the forum:
Retrieving data ...