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.

Record made in the last 7 days

Featured Replies

Hello Board!
 

I've nearly completed the overhaul of my FM app thanks to your help. It's looking great.

One step that i'm stuck on is a validation script.

I have the user scan a barcode into a Custom Dialog Box. FM sets this as $UI and then runs a

 

IF [Length ($UI)<>10}

Exit Script

Else....

 

to make sure it's only 10 digits long. I also want to reject (exit script) it if that $UI barcode has been scanned in the last 7 days.

 

I'm sure this is possible.

 

I would have to run a search for that $ in the table, then do something like 'GetTodaysDate' and then do some sort of match against 'TodaysDate' - 7Days???

I have no idea how this would work.

 

Any help you can give me would be greatly appreciated as always.

 

H

You could modify your existing step as:

 

Length ($UI)<>10

OR

yourTable::yourDate > Get ( CurrentDate ) - 7

  • Author

Hi!

 

Thanks! My <> doesn't work for a start...

 

Set Field [uI::UI Number; $UI]

If [Length(UI::UI Number)<>10]

Delete Record/Request [no dialog]

Exit Script []

End If

 

Can you see what's wrong with it? It's long winded, i suppose. Can i just ask if the variable is <>10, rather than setting a field as the Var and then questioning that field contents?

 

But thanks for writing out the date issue. I could not figure it out. I can just use '7' rather than '7' days? How can i get it to look at 7 seconds or 7 weeks or 7 months?

 

Thank  you again!

 

H

Why don’t use the tools that you paid for. i.e. Script Debugger and Data Viewer?

I have the user scan a barcode into a Custom Dialog Box. FM sets this as $UI

 

Since you scan into a field first, you can start with:

 

If  [ Length ( ScanInputField ) ≠ 10 ]

# reject

Else

# accept and continue

...

End If

 

Ideally, the ScanInputField would be a global field, so you would not need to delete the record upon reject. Instead, create a new record only on accept.

 

 

 

I would have to run a search for that $ in the table, then do something like 'GetTodaysDate' and then do some sort of match against 'TodaysDate' - 7Days???

 

 

Well, you could define a relationship showing any records with a matching barcode and creation date in the last 7 days. But performing a find would work too. You can do it all in one by finding records where the barcode = gScanInputField AND creation date ≥ Get ( Currentdate ) + 7.

  • 5 months later...
  • Author

Nice, thanks again guys. I'm just getting my head around the logic.

 

Appreciate it.

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.