Jump to content

Anybody could help for using Enter Find Mode.


This topic is 1439 days old. Please don't post here. Open a new topic instead.

Recommended Posts

i am currently building an application for Water Billing System.

I have 2 tables:

wb-which is the Customers Information.

Transactions-for the Water Meter Readings Record.

i am working on my reports layouts for filtering using 2 global fields. that i set before opening my report layouts.

Global Fields-g_Address & g_Month.

this my script that i am using.

Set Variable[$Address; Value:g_Address]

Set Variable[$Month;Value:g_Month]

Enter Find Mode[]

Set Field [wb::Address;$Address]

New Record/Request

Set Field [Transactions::Month;$Month]

Perform Find[]

i have set this on Script Triggers-OnRecordLoad

but when trying my cursor just loading but it did not show what i want to filter.

Please help!

 

 

Link to comment
Share on other sites

You don't need to set variables first, just use the global fields in the find request.  Not that it would change anything but it's just not needed.

Also note that when searching on text fields and you want an exact match you need to prepend the find request wtih "==" Otherwise if your global field says "123 Derry" the search as you have it will find all addresses that *start with* that string, so it will find "123 Derry" and "123 Derry Road" and "123 Derrymaid" and so on.

Your search request does an OR find: give me all record with this address OR this month.  If you want all address for the given month then don't use "new request" and use both fields in the same request.

 

Link to comment
Share on other sites

Thank you for that positive response sir,

when i tried it to run manually from the scripts, it runs just as i want and the results that i wanted.

but when i load it in Script Triggers (On Record Load)

it loads and the cursor keeps loading.

how do i stop the find when it is finished finding the data?

Link to comment
Share on other sites

It's kind of a weird script to run on record load. What's happening is that each time you go from Find mode to Browse mode, the script triggers itself again, so you're stuck in an endless loop.

One way to work around this would be to put something like this at the top of the script:

If[ $$Halt ]
  Set Variable[ $$Halt ; 0 ]
  Halt Script
Else
  Set Variable[ $$Halt ; 1 ]
End If

 

Link to comment
Share on other sites

Not sure what you mean; are you talking about capturing what the user wants to search on?  Then yes: you can use that.  And as I mentioned in my earlier response, you don't need to set the globals to variables, just use the globals.

Further to @Fitch's response: don't use a trigger to run this script, just give the user a button after the enter the globals and let the button run the script.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.