Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Juggernaut

Finding range in currency

Featured Replies

I need to find a range in currency between a field named "low rent" and a field named "high rent". I want to search for properties within a low and high rent range. I also don't want to use the "find" view, I'd like to script it to a button to produce the found set in a portal. Any ideas?

Thanks!

This can be done by creating an additional global field (let's day called 'gRanges') which acts as a multi-key field for a relationship (which is the basis of your portal).

Once the low and high amounts are entered into global number fields provided for the purpose, your script should then run a looping procedure to increment the lower value by one, adding each result (separated by a carriage return) to the 'gRanges' field, until it reaches the high amount.

The gRanges values will then match to any corresponding values in the related file, and they will be displayed in the portal.

Assuming you have a bunch of records, each with a value in a "RentAmount" field, and you want to be able to enter values for "LowRent" and "HighRent" and then search to see what fits...

Create two global fields, gLow and gHigh, that return numbers (oh yeah, the RentAmount field should be a number too). Then when the fields are filled in, have the button activated script:

Enter Find mode

Set field ["RentAmount", "gLow and "..." and gHigh"]

Perform Find

That should do it.

While that should do it, things always seem to be more complex when put into actual use. You may want to include a conditional or two to or three into the script", e.g.???

If ["IsEmpty(glow) or IsEmpty(ghigh)"]

Show Message ["Two numbers are required for a range."]

Halt Script

Else

Set Error Caputre [On]

Enter Find Mode []

Set Field ["RentAmount", "gLow and "..." and gHigh"]

Perform Find

If [" Status(CurrentError) = 401 "]

Clear [select , "gLow"]

Clear [select , "gHigh"]

Show Message [" No Records, try another set of numbers "]

Else

*here you might add navigationals to a "show record" layout if only one record is found

else a "view list" layout if a number of records are found,

and in those Else-If conditionals also clear the global fields so the next user does not find the fields populated.

Then use as many end-ifs as necessary.

Yo, Old Hands, he said he wants it in a PORTAL. I suggest a combination of the scripted Find and the multi-line key field:

1. Perform the Find as in the scripts above.

Script this:

2. In the child file, go to a layout that has ONLY the record id (or serial number, or whatever you want to call the unique identifier of the record -- you do have one, I hope?)

3. Copy All Records

4. In the parent file, go to a layout that has a global text field on it, let's say gText, and Paste

5. Your portal should be related gText::record id

All done!

Note 1: by "parent" file, I mean the one on the left side of the relationship, even if we're talking about a self-join -- child file is on the right.

Note 2: I would add to Keith's script that users tend to be annoyed when you clear the fields after a Find. Better to do a Modify Last Find so they can see the values they already tried -- Maybe they only need to change one of them.

Chili beans. I guess I read it half-fast and answered it the same way.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.