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.

Scripted re-lookup of single record

Featured Replies

The Customers DB record contains a Telephone number and name/address information. The Invoices DB record contains a Telephone number, as well as name/address fields that are defined as Lookup from Customers based on Telephone.

When I add a new customer, I start by typing his tele. no. and name/address in the Invoices record, and clicking a button to drive AddCustomer script. That, in turn, drives an external script in Customers which creates a new record and populates it by reading the relevant fields from the current record in Invoices. So far, so good. The external script then pauses to display the newly-added Customers record, allowing it to be doublechecked and edited if need be. When done, you click Continue, allowing Invoice's AddCustomer script to continue.

At this point, I want the Invoice name and address fields to re-look themselves up, just in case the user made any changes during the doublecheck.

To do this, I copy and paste the Telephone number into itself. Now I believe I have to move the cursor somewhere else to trigger the lookup. I can do that with Goto Next Field, but I'd like to have it move back to the field the user had it in before he ran AddCustomer.

So two questions:

-- is this a clean way to trigger a relookup?

-- how does one get the cursor back into some field? Goto Field doesn't seem to have a form allowing a variable value (such as that returned by Status(CurrentField)).

Scripts | Relookup Field Contents

  • Author

I had done that, and very nearly ruined a production database this morning. I need to relookup for the *current* record only. Or am I missing an option in the "Relookup Contents" script step?

Try:

Set Field [ "Phone#" ; "Phone#" ]

This replaces the Phone# with the existing value for the current record only. In version 7, focus is left in the previous field, but I haven't tested it with FM6.

  • Author

Thanks -- it does seem to lose focus in V6, but it's not the end of the world and your approach is dead simple.

Chap

OOPS: I see in FM Help that Relookup applies to all records in the Found Set.

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.