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.

Find the closest reseller ~ best way to set it up

Featured Replies

  • Newbies

Long time reader, 1st time posting, so sorry in advance if I did it wrong.

I want to create a script that will return the closest reseller of parts based on zip code the consumer submits. I understand how zip codes work. My question is what's the best way of doings this with out multiple find requests looping a script.

Things to keep in mind

For this example I have 1 table with company and zip code.

There is not a reseller in every zip code

The only way I know how to do this is

A- multiple finds

Make a script that will do a search, then based on the found count widen the results for another search

B- relationship

Make a relationship with a temp field. Then make a script to adjust temp field based on number of records in portal.

Anyone know if you can tell fm to grab the closest match based on a found set? Maybe a weighted sort of some kind.

Thanks

I understand how zip codes work.

 

Apparently I don't, because I don't understand your question. If all you have is zip codes, and the zip code submitted by the customer doesn't match one of yours, I don't see how you can "widen the search". That is, unless you also have the relevant geolocation data of both the customer (i.e. you have a way to lookup the customer's latitude and longitude, based on their zip code) and of all your resellers.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.