Skip 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.

How do I relate to the last related record?

Featured Replies

I need a little bit of help.  I am trying to relate an invoice table to my currency rates table, I want to always get the last rate rather than all rates.  How do I do this?

I have two tables Invoices and Exchange rates.

An Invoice exchange rate would be €1.00 is 1.1006 31st October 2015

                                                              €1.00 was 1.1201 in 1st October   (this might be the last time it was updated)

 

How do I get the system to always default to the last value entered? So if I enter a new invoice today the rates will always take the rate entered today rather than the one entered on 1st October.

Edited by genious

If you sort the records on the Exchange rates side of the relationship by Date, descending, then the latest record will become the first related record and the value will be looked up from there.

Alternatively, you could auto-enter a calculated value = Last ( Exchange rates::Rate ) instead of a lookup.

A more elaborate solution would add the Date field as a second matchfield in the relationship - so that the lookup finds the correct rate even if the record is backdated.

Edited by comment

  • Author

Yes that sounds like what I will do.  The relationship will be based on the Identifier of the currency and it should be less than or equal to the date of the invoice, sorted descending by date.  Perfectly logical!  Many thanks for your help.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.