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 get the most recently created record?

Featured Replies

Hello,

In a script, I am trying to set a local variable as one of the fields of the most recently created record. What script step will get me the most recent record? Every record has a timestamp create field but I don't seem to find any appropriate script step that will get this done.

Could it be as simple as:

:Show All Records

:Sort Records (Decending by timestamp)

:Go to record [First]

:Set Variable [$local; Value:Appropriate field]

It could be even simpler:

Show All Records

Unsort Records

Go to Record [Last]

Set Variable [$local; Value:Appropriate field]

  • Author

I guess that's why they pay you the big bucks! B)

Is this an efficient way to validate?


Commit Records [skip data validation; No Dialog]

Show All Records

Sort Records [No dialog] (timestamp;decending)

Go to Record [First]

Set Variable[$PartNumCheck; Value:Products::Part Number]

Go to Record [Next]

  Loop

   If[$PartNumCheck = Products::Part Number]

    Show Custom Dialog ["blah blah blah... back to order form"]

    Go to Record [No dialog; Products::Part Number = $PartNumCheck]

    Delete Record [No dialog]

    Close Window

    Exit Script []

   End If

  Go to Record [Next; Exit after last]

 End Loop

The Custom dialog box is purpose for avoiding FM validation.

Is this an efficient way to validate?

No, certainly not in version 11.

CustomValidate11.zip

  • Author

That is a great way to validate. I would never have arrived at such a simple method. I could not, however, get your Custom dialog box to work. It's like it was stuck in a loop. If I entered info into the diag box and then tried to leave the unique field, it falsely found an existing record. I'll keep trying to figure it out, but thanks so much. I hope other newbs benefit from it too

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.