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.

Featured Replies

I have the following scrip that does not work...

Set Field [Job System::gdate; Middle (Job System::date ; 4; 2)]

If [Left (Job System::gdate; 2) = "1/" or "2/" or "3/" or "4/" or "5/" or "6/" or "7/" or "8/" or "9/"]

Set Field [Job System::gdate; Middle (Job System::date ; 3; 2)]

Else

Exit Script

End If

I think there is something wrong with the If statement, because it performs: Set Field [Job System::gdate; Middle (Job System::date ; 3; 2)] no matter what it finds.

Can anyone point out where I am going wrong?

What format are you using for date and gdate?

  • Author

date is a date field, and gdate is a text field

  • Author

I tried simplifying the scrip to...

Set Field [Job System::gdate; Middle (Job System::date ; 4; 2)]

If [Job System::gdate = "1/" or "2/" or "3/" or "4/" or "5/" or "6/" or "7/" or "8/" or "9/"]

Set Field [Job System::gdate; Middle (Job System::date ; 3; 2)]

End If

But it still doesn't work, its like its just ignoring the If statement and resetting the field no matter what!

Why not use

Set Field [Job System::gdate; Day(Job System::date)]?

You'll get the same result in one step.

  • Author

Because I want the month not the day. I'm from New Zealand where the date is formatted dd/mm/yy.

Then use Month(Job System::date). Date functions don't care about your system settings. They'll still return the right result.

  • Author

No wait, I figured it out... the date fields are formatted mm/dd/yy. Once I changed them to our format, it worked!

Thanks smile.gif

The format shouldn't matter, because dates are internally stored as numbers. So Month(datefield) will work for any legal format or system setting since it doesn't pay attention to them.

But Cat8 is using string manipulation commands, like Left and Middle, and so I think it would matter. That's why I asked for the format of date and gdate.

I was referring to format, not field type. And yes, Cat was using string commands that aren't necessary when a simple Month( ) function will suffice. wink.gif

Right. Why use string manipulation when the month function will work regardless of field format!

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.