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.

Trouble with find mode script

Featured Replies

I'm trying to use a script found in another post:

Enter Find Mode[]

Set Field[MyTable::MyDateField; (Get(CurrentDate) - 30)&"..."Get(Current Date)"]

Perform Find[]

However, I keep getting an error message that an operator is expected after the semicolon.

Am I missing something?

(Get(CurrentDate) - 30)&"..."Get(Current Date)

(Get(CurrentDate) - 30)&"..." [color:red]& Get(Current Date)

--sd

  • Author

Thanks, however my problem is here:

Enter Find Mode[]

Set Field[MyTable::MyDateField[color:red]; (Get(CurrentDate) - 30)&"..."Get(Current Date)"]

Perform Find[]

You're missing an [color:red]& in your calc...

--sd

  • Author

${Territory}:):language updated[color:red]; (Get(CurrentDate) - 30)&"..." & Get(Current Date)

I actually had the "&" in the script, simply left it out of my comment. However, my problem is after the [color:red]";".

Error message indicates I need an operator there.

need to use GetAsText:

${Territory}:):language updated; GetAsText((Get(CurrentDate) - 30)&"..." & Get(Current Date))

Edited by Guest
missed ( )

  • Author

Thanks, but my problem is after the semicolon. Script message indicates it's looking for an operator between [color:red]";" and whatever follows.

You don't tell the Set Field script step what field to set in the calculation. The calculation is the result only. The field is defined via a separate dialog (Specify target field) which is a drop down list of all fields.

You haven't really named your tables and fields with $ and () characters have you?

yes, it needs you to explicitly tell it the result to set into the field is TEXT although you are using the date range. the field that you are trying to set is a date field hence to insert a date range you need to use "GetAsText"

Only if the field isn't on the layout, a Go To Field can make it happen "amputated" the field where to put it. But if the semicolon is part of the calc', is it pretty obvious why the bleeping happens.

GetAsText( is not necessary doe to the ampersands already in there. Breezer you are right it used to be so before fm7!

--sd

the field that you are trying to set is a date field hence to insert a date range you need to use "GetAsText"

I'm pretty sure that's not accurate.

Thanks Soren and D J for pointing that out, all along I have been assuming it's required.

Edited by Guest

  • Author

Okay, now I'm getting it. However, the script is not responding the way I expected it to. I want it to find all records with a date (in specified field) 'older than' 30 days from current date.

Today,

Get(CurrentDate) - 30) & "..."& Get(Current Date)

is

12/30/2007...1/29/2007

You'll have to change your calculation.

The easiest way is to make it an omitted request, provided you have nothing after today, it's done by adding an Omit Record/Request step just before the Perform find.

--sd

I want it to find all records with a date (in specified field) 'older than' 30 days from current date.

Why not say so right at the start. Try:

Enter Find Mode [ ]

Set Field [ YourTable::Datefield ; "<" & Get ( CurrentDate ) - 30 ]

Perform Find [ ]

  • Author

Okay, it's working.

For future reference, I was using the "Calculating result" option for everything, but once DJ noted I had to use the "Specified Target Field" also it all came together.

Thanks!!

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.