What would be the best practice for setting up Creation/Modification housekeeping fields for User IP address?
Get (SystemIPAddress) ?
How would you set up such a field so it behaves as a modification auto-enter field?
Let's say that you have an auto-entered modification date field named ModDate.
Let ( Trigger = ModDate ; Get ( SystemIPAddress ) )
Clear the "do not replace existing values..." check box
Will auto-enter the results of that function each time that the ModDate field is updated--and that will happen any time that the record is modified.
Excellent! Thanks Phil!
Auto Enter with Do not replace existing value of field (if any) unchecked will update on record modification with the following calculation:
trigger = GetField ("") ;
Just out of curiosity what housekeeping do you plan that requires the user's IP instead of accountname?
I guess we typed at the same time :-)
It's not instead of account name. It's in addition to Account name, User name, timestamp. It's at the client's request for an on-line form their customer's fill out.
Online form with native FM Get function must be WebDirect then?
Just keep in mind that WebDirect does not return the users IP address in case there is a reversed proxy in between the browser and the server. (We have such a setup)
Yes, it is WebDirect. And I am aware of that issue. If that is a concern for the client (I am dealing with an in-house Filemaker developer) then we can cross that bridge in the next day or two.
I was reading about parsing an Insert From URL from http://checkip.dyndns.org
Seems it has drawbacks as well. Here is that article:
Quickey tested that technique but it working fine in Pro it returns the WAN of the server in WebDirect. Actualky that makes sense given that we can only script this and scripts are technically running on server in WD.
By the way, another issue with WD (or actually with any client, but more with WD) is that we never know the timezone setting of the user. Creation and modification time stamps return according to the users setting.
I'm using the very same trick with trigger = GetField ("") to grap Get(CurrentHostTimestamp). If you want dates and times in separate fields you can use GetAsDate ( Get(CurrentHostTimestamp) ) and same with GetAsTime. Ofcourse we can use Get(UTCMilliseconds) but that requires calculations again if we need the date and time.
That's a good point. Thanks for reminding me of that. I will mention this to my client as well.
Hmmm, arjen.evertse, do you know why your example updates with each record modification? I know why mine does, any auto-enter calculation with "do not replace.." cleared will update anytime a field referenced in the calculation updates.
But getField is referencing an empty string, no references to any fields that might modified. It works, I had to test it myself to confirm, but do you know why/how it works?
Well... philmodjunk I actually don't know. And your question made me thinking about that there is no reasonable clarification it this is intended behavior or not.
It makes me also think that it is probably not a good choice unless someone at FMI confirms this is intended, cause if it is not they might 'fix' it some day breaking any solution build on this behavior.
I hear you. It might be a question worth asking at DEVCON if I can corner the right person. The shorter sessions may make for a lot less Q & A opportunities.
As a case in point, my Adventures in FileMaking 2-enhanced value selection instructional file had a cool trick that I figured out for hiding the ID value in a drop down list field, even when editing the field to select a different value than previously selected. But it only worked in FMP 13. Changes in 14 "fixed" the undocumented behavior and version 12 didn't have the feature to exploit...
Retrieving data ...