Overriding default Modified By (clarisCloud)

For those of you following along, I'm switching hosting from AWS to Claris Cloud, which sets everyone's username to their email assigned with Claris. So in the past while my username might have been jmark it's now jmark234@whatever.com.

If this was new solution on Claris it wouldn't be a problem, but since so many joins use username (i.e. these are the tasks assigned to you, these are the students assigned to you) it means I need to normalize the data and change how things are connected.

I have a couple of ways to do that. The way I'm leaning towards is:

I have a variable called $$WhoAmI that is their account name. I've actually used that throughout my code, so if I change this all my calls that check against account name will "just work".

Since I already have a staff table which keeps track of usernames and emails I have a line of code which tests for AccountNames that have "@" and look up the standard account name (i.e. jmark234@whatever.com just becomes "jmark".

This means that any script I have already written which uses or tests $$WhoAmI will just work, and my relationships will still work.

The place that I'm stumped is "modified by".

I wrote a custom function and tried changing how the ModifiedBy to "do the right thing"... but it doesn't seem to trigger when I modify the record.

Is there some trick to getting the auto calcs to happen whenever a record is modified/committed?

1 Like

You should be able to have your auto-enter trigger if you add a field like the modification timestamp as a reference in it. Something like this:

Let ( [
~myTrigger = <myLastModifiedTimeStampField>
] ; 



Right - I'd recommend the same thing - use a ModifedTimestamp auto-enter field as a trigger. Another somewhat surprising thing you can do for a trigger is this: GetField ( "" )
Believe it or not, that is triggered if any field is modified, although I think you have to uncheck the "Do not evaluate if all referenced fields are empty" option in the calculation window.
By the way, while you're updating all your meta-fields anyway, a potentially useful trick is to include a way to programmatically turn off the auto-enter calc, using something like this:

/* version 1.1 */
Let ( [ 
		trigger = zz_ModTStmp 
		Self ;
		Get ( AccountName ) 

Then, you can set a local variable within a script (the $ variable) as a "automatically stops blocking auto-enter when script ends" method of preserving existing metadata when specific processes need to modify records in a way that doesn't trample on existing metadata. The global variable (double-$) could also be used, but VERY carefully, since it will stick around once you set it until you turn it back off.


Thank you both.

@DanShockley I actually created a custom function that does exactly what you said, but I also added it to my LastModifiedTimestamp so it became a loop and Filemaker ignored it... but using your GetField ("") works in both the timestamp and the last modified by..

Thank you!

In case it's helpful to other people here are the custom functions I'm using. I did need to uncheck the "Do not evaluate if all referenced fields are empty" checkbox.


$$DoNotUpdateLastModified = 1  or $DoNotUpdateLastModified = 1  ;

ClarisCloud_SetModifiedTimestamp (ModificationTimestamp)

$$DoNotUpdateLastModified = 1  or $DoNotUpdateLastModified = 1  ;