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.
Juggernaut

Automatic set field on record modify

Featured Replies

Hi all

FM Dev5.5 on WinXP pro

I want to be able to set a field to a field value, the users name, when a record is modified, but I do not want to use the modifier name which grabs the username in the FM Application Prefs.

I have a login system which the user has their own login and password which is linked to their full name on sign up to access teh system, this all works well, and I have a series of globals to set the current users name in a global field upon login in a Globals file from which to grab the modified record username from when a record is modified. All that seems to be working fine, but I am not sure how to define a 'modified by' field to automatically calculate itself, and set itself automatically to the users name whenever any field in the record is modified.

I have tried a number of options and for the life of me cannot figure this one out and I am pretty sure that since FM has a standard auto modified by feature (to add the App-Prefs username) there should be a way of doing this, its probably quite simple but just cannot find what I am looking for to get it to work.

So over to you guys for some help, many thanks.

Greg

Check the Article section for Ray's complete solution in indexing unstored values.

Basically, you'd use a lookup to retrieve in an index the g_UserName or any unstored calculation you're using for it.

This lookup will be triggered anytime a record is modified, and you could concanate this new index with the Modification Time and Hour on to another indexed field.

The lookup would involve these fields

ID

ModTime (autoentered modification time)

g_Username

c_Trigger = (ModTime*0)+ID

TriggerModRel = c_Trigger::ID

t_Username = Lookup from g_Username by TriggerModRel

HTH

  • Author

Ok thanks - worked it out based on what you suggested - knew it would not be too difficult - many thanks

Greg

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.