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.

Entering a specific field in a script

Featured Replies

I have a field set as a button, so that when a user clicks on that field to edit it, it will run a script to compare Today to the Modified Date. If they choose that they still want to edit it, it will enter that field. Problem is, I need a script for every field on the layout. This isn't a problem, just real time consuming. Is there a universal way to get to the specific field that they clicked on? Here is my code:

If [Modified Date <> Today or ""]

Show Message [buttons: "Edit Record", "Cancel", "";Data:"This is an

existing MWR. Do you wish to Edit this record?"]

If [status( CurrentMessageChoice) = 1]

Show Message [buttons: "OK", "", "";Data: "You have chosen to edit

this record. you may now continue."]

Set Field [Modified Date, Today]

Go To Field [Test]

End If

Else

Go to Field [Test]

End If

I would like to get rid of the "Go to Field - Test" as that is what would change on all of the scripts. Any suggestions?

Thanks.

Yes, I have a suggestion... but I'm Italian and My English isn't so good!

I suggest you the TopTip in the Tips Forum, but it was written for .fp7.

I know it works with .fp5 too.

  • Author

I'm looking it over, but honestly I'm a newbie, and I'm trying to decide if this will work for me or not, and if so, how to convert it to mine.

Hi Donnie,

No, no suggestions, because I'm unsure why you are using this process. If a User accidently TABS to the field, your script will not fire. crazy.gif

If they modify the record, and you have a field (date) called Modification Date set to Auto-Enter, you can select 'Modification Date'. Every time they change the record, this date will change without need of script. This is ONE exception to the regular rule (in versions less than 7) which enters data (with Auto-Enter) ONLY upon record creation. Modification Date will always change to the current date anyway. This Modification Date behavior is what is replicated in vs. 7 when using Auto-Enter (unclick Do Not Replace Existing Value); which can now be applied to all standard fields within a table.

Whatever you are attempting to do (notify Users that this record has already been changed on the current date?) might be better addressed in other ways: Use script to compare Modification Date to current date BEFORE layout switch and ask your question then. Only if their answer is yes, switch them to layout in which they can modify all fields freely. Or even ... just place a large red calculation (text, unstored) at the top of the layout. It could be something like:

If(ModificationDate = Status(CurrentDate); "This record has already been changed today.")

LaRetta wink.gif

ok,

i'll try to explain, but it will be better if someone else explain to you.

1) make a calculated number field: Status(CurrentRecordNumber)

2) make a self-relationship by that field

3) make a portal of one line

4) put one field (as Test) inside the portal and make it not accessible to write

5) make the field a button

6) link this script to that field:

 If [Modified Date <> Today]

   Show Message [buttons: "Edit Record", "Cancel", "";Data:"This is an

   existing MWR. Do you wish to Edit this record?"]

 If [status( CurrentMessageChoice) = 1]

   Set Field [Modified Date, Today]

  go to portal row [first]

  Set field[]

 End if

else

  go to portal row [first]

  Set field[]

End if 

7) Repeat 3) 4) 5) and 6) for all your fields.

note that the set field[] don't know which field you clicked, but the cursor will be inside the right field !!

This is why I named it the TopTip

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.