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.

Reusable Script Trigger

Featured Replies

I'm trying to design a script trigger that would whenever the date in field "date1" is a Sunday would allow returning the cursor to the field "date1" clearing the field content and displaying a message stating a Sunday date was just entered please correct.

The only lines of code I believe I have completed is: DayName(Get ( ActiveFieldContents ))="Sunday"

as well as the message.

This script being the basis I would then like to repurpose it in "date2" without hard coding the field the field name.

I would greatly appreciate any assistance I can receive with this procedure.

  • Author

I did work on a solution myself.The following is my script. I still hope to see some feedback.

Script is set to trigger on object exit. I did give the object(field) the same name as the field because I couldn't see how to return to the active field name without using go to object.

CheckDay

If [ DayName(Get ( ActiveFieldContents ))="Sunday" ]

Set Variable [ $FieldName; Value:Get ( ActiveFieldName ) ]

Show Custom Dialog [ Title: "Edit:" & " " & Quote ("Date"); Message: "Please Review Entry...Date Entered Is A Sunday"; Buttons: “OK” ]

Go to Object [ Object Name: "$FieldName" ]

Clear [ ]

[ Select ]

Go to Previous Field

Go to Next Field

Set Field By Name [ Get ( ActiveFieldTableName) & "::" & Get ( ActiveFieldName ); Get ( CurrentDate ]

Halt Script

End If

How about something simple:

If [ DayOfWeek ( GetField ( Get ( ActiveFieldName ) ) ) = 1 ]

Show Custom Dialog [ "Please review..." ]

Clear [ Select ]

Exit Script [ Result: False ]

End If

Run this script OnObjectSave. Note that this is not a replacement for field validation.

  • Author

Thank you for the streamlined script. It worked very well.

I just have one more question: I have the calendar attached to the date field is there an easier way to reselect the field so the calendar pops up if the date needs to be modified? Now I'm using go to previous field go to next field to have the calendar pop-up.

I'm afraid I don't have a better idea.

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.