321 Posted July 21, 2004 Posted July 21, 2004 Hello all, I am trying to create a log of changes to a field using John Osbournes technique from his sample file "Change Log". It tracks who, when, what field, and what data was changed into a log field. I have no problems creating the log when the data entry is done in the same file (not through a file reference) as the data. But when I do data entry to the exact same Table Occurrence through a file reference, the changes are not logged. Anyone have an inkling why? or what to do about it? Below I have attached the code, which is set to auto enter with the do not replace existing value unchecked, for the log field (it is in the same table as the field modification it is logging) Case(PatternCount("Textfield"; Get(ActiveFieldName));"- " & GetAsText(Get(CurrentDate)) & " | " & GetAsText(Get(CurrentTime)) & " | " & Get(AccountName) & " | " & Get(ActiveFieldName) & " = " & Case(Get(ActiveFieldName) = "Textfield"; Textfield; ) & Case(not IsEmpty(Log); "
CobaltSky Posted July 21, 2004 Posted July 21, 2004 Hello Eric, Yes, I can tell you why. The Get ( ActiveFieldName ) function in Filemaker 7 operates only within the domain of the current file - it will not return the name of a field in another file that the cursor may be in. This arises from the different way in which FileMaker 7 handles windowing and window states. As a consequence, if the cursor is in a field which is on a layout in an interface file and the log calc is being evaluated in a separate data file, the calc will return a null response for the Get ( ActiveFieldName ) function. The solution is to define an unstored calc in the file where the edits are to take place (eg in the interface file) with the formula specified as Get ( ActiveFieldName ), then reference this field via a relationship from the data file, including it in your log calc in place of the Get ( ActiveFieldName ) function. That will get your logs on track.
321 Posted July 22, 2004 Author Posted July 22, 2004 You Rock Ray! I used the technique you explained and it works very nice so far. (have yet to test every angle). I don't know if there is a better way to set up the relationship, but I used the cartesian "x" to relate the Get (ActiveFieldName) calculation in the interface file to the primary ID in the table where the data file is. (I guess it doesn't matter what fields you use for relationships with the "x") Thanks again, Melbourne huh... lucky you, can check out some Aussie Rules at the MCG.
Recommended Posts
This topic is 7499 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now