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.

Get ( ) calculations don't work on Server scheduled scripts?

Featured Replies

I have been having a problem today trying to set up a script that runs on the server overnight which will gather currencies and security prices that need to be updated with the market closing values of the previous day. This script involved setting a filter field with the value Get ( currentdate ) - 1. The script runs with no errors but the filter field is not being set. It remains empty. When running this in a client, it works flawlessly.

I found an article today which discusses differences in scripts being run on the client vs. the host. The article was not very clear but it seemed to imply that many of the Get ( ) functions return an empty value when running on the server.

Can anybody verify if this is the case, and which functions will not work? The error logging for server side scripts is abysmal, and in this case, non-existent.

If in fact this is true, would anybody know a workaround for the Get ( currentdate) function that would work on a scheduled script? I was quite dismayed to read this about Get ( ) functions as this makes server scheduled scripts practically useless for my purposes. And I had such big plans!

There should be no problems with current date.

Is this filter field global? Is it a date or text field?

  • Author

The filter field is a global date field.

I think your problem is that globals are specific to the user who sets them. So in order to see a global value set by the server, you would have to be the server :)

  • Author

You are absolutely right Ron. I don't know why I didn't think about that.

The big problem is that you cannot troubleshoot a script running on the server like you can with debugger. I guess I will have to run some tests with data that I can verify to see if the result will be as it should be with the global date field having been set correctly. It could very well be that the server did it correctly, despite me not seeing the filter field set on the table.

Ron's diagnosed it. You can set a non-global field and have an On File Open script grab the non-global and load it into a global.

  • Author

I have actually tested it by setting another date field, having the server set the global field to Get ( CurrentDate ) - 1 and then doing a replace field contents step, setting the new date field to the value in the global field and it comes back with the correct data.

Thanks all.

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.