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 to search for last number in a field?

Featured Replies

Hi all,

Each one of my Records has a Contract layout but not every record has a contract. When I come to draw up a new contract I would like to find the last contract number in the field using a button on the Contract layout.

Any ideas?

A reverse sort order for the relation comes to mind!

--sd

  • Author

Can I just sort by the contract field and then copy and paste that number in my new record?

Hi

how about a calculated field (LastContractNumber) and calc: Max(rel::contractNumber) ?

I do hardly suggest anyone to utilize copy/paste, and in particular now when GeNthRecord( esists.

I know I was a little snotty in my previous reply, because what if not relations exists. What you can do is to make a valuelist based upon the contractnumber, the issue you probably here raises, is that autoentering isn't strictly fitting into your business model which could be "Give the emperor what is the emperor's and give God-what is God's." kind of bookkeeping :P

Set Field [ Untitled::contractNumber; GetAsNumber ( RightWords ( ValueListItems ( Get ( FileName ) ; "theNumbers" ) ; 1 ) )+1 ]

What it does is to sort the numbers prefereably with leading zeros via a valuelist, causing the latest entry to latest in the valuelist, convert the list which is in textformat back into numerical and add one to it.

--sd

See here.

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.