Jump to content
Sign in to follow this  
saranyc

GENIUS or MORONIC?

Recommended Posts

A group of amateur developers at the office came up with the following, and we think it is almost too good to be true, especially bc we've never read anything about this- except for a global calc posting in the forums a number of months ago. Here it is:

We want to track certain fields, to follow when which user changes data in each, so we made a calculation for each such field that gets the value, gets the current timestamp and user, then skips a line, and references itself. You can only do this if you create the calc first so it shows up in the field list- then you can go back and add the self-reference.

We were shocked fm allowed us to do this, but it is working exactly as we had hoped. Anyone have any thoughts- is this likely to corrupt our data or crash the system?

The calc (FieldChange) looks like this if you are tracking a field called Name:

Get (AccountName) & " " & Get (CurrentTimestamp) & " " & Name &

"---------"

FieldChange

Obvious glitches? Things to consider? Thoughts?

While I really hope everyone votes "genius", I'd way rather hear any nagging concerns you serious fm people have.

Thanks!

Sara

Share this post


Link to post
Share on other sites

Hi Sara,

A few things:

A ) Get (AccountName) & " " & Get (CurrentTimestamp) & " " & Name &

"¶---------¶"

FieldChange

Should be in an text based calc field with do not replace existing values unchecked -- as opposed to a calc field...

B ) You may want to chuck a couple of pilcrows in.

C ) There are more complex versions of this lying around on the forums -- Its called an audit trail. This recent topic has a few links that will be of use: http://www.fmforums.com/forum/showtopic.php?tid/186957/post/251295/hl/audit+trail/

Share this post


Link to post
Share on other sites

Thanks very much.

(I was too lazy to add the pilcrows when I retyped the calc [and too lazy to copy/paste too], but we had them in there.)

It sounds like you are saying we should use an auto-enter calc- that's the only place I can see to uncheck that box- what is the benefit of an auto-enter over our calc?

Here is the copied/pasted calc we have:

If ( DeleteFlg = 1 ; "" ; If (

Middle ( Itself ;

( Position ( Itself ; "*" ; 1 ; 2 ) + 1 ) ;

( ( Position ( Itself ; "," ; 1 ; 2 ) ) - ( Position ( Itself ; "*" ; 1 ; 2 ) + 1 ) ) ) = field ; Itself ;

"*" &

Middle ( Itself ;

( Position ( Itself ; "*" ; 1 ; 2 ) + 1 ) ;

( ( Position ( Itself ; "," ; 1 ; 2 ) ) - ( Position ( Itself ; "*" ; 1 ; 2 ) + 1 ) ) )

& ", *"

& field

& ", "

& Get ( CurrentTimeStamp ) & ", "

& Get ( AccountName ) & ", "

& Get ( RecordID )

& ¶

& Itself ) )

The position stuff is just to get the old value of the field... ignore that..

We plan to fill in the deleteswitch after each export (to a new table) of all the old changes, so as not to have too long a field.

Other thoughts or suggestions?

Thanks again.

sara

Share this post


Link to post
Share on other sites

Calcs can be reset accidentally... a lot harder to wipe the data out of text fields.

Other than that, nothing I guess.

In relation to your calc though, you might want to try the Let statement, helps to actually make out what your doing lol.

Let( [

_itself = Itself;

_pos1 = Position (_itself; "*" ; 1 ; 2 ) + 1;

_pos2 = Position (_itself ; "," ; 1 ; 2 ) - Position ( _itself ; "*" ; 1 ; 2 ) + 1 ;

_value = Middle( _itself ; _pos1 ; _pos2 )

];

If ( DeleteFlg = 1 ; "" ;

If (_value = field ;_itself ;

"*"

& _value

& ", *"

& field

& ", "

& Get ( CurrentTimeStamp ) & ", "

& Get ( AccountName ) & ", "

& Get ( RecordID )

& ¶

& _itself

)//End Sub If Statement

)//End Delete Flag Check If Statement

)//End Let Statement

Edited by Guest
Slipped into coding php by accident

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • By Tumma K
      Hello, All!

      I am an aspiring developer for Filemaker. The company I work with is stuck in the past working off of Filemaker Pro 4.1

      I was given the task of bringing us up to Filemaker Pro/Server 13. So far my conversion prototypes are successful but we recently had a layout issue that can only be fixed in versions 3-6 (as the file is an .fp3) I work off of a macbook while our network is all Windows 7. In order for me to repair the layouts without tampering our active database, I decided the best option is to repair a copy of our solutions off the network. Unfortunately, when I go to download the trial version of Filemaker Pro 6 off of the respected website, the file is corrupt! I've tried multiple times, with different extraction apps and in different directories.

      My question is;

      Does anyone know a place where I could obtain version 6 (or better yet, 4.0) for an OSX computer? I've looked everywhere!
       
      Thank you for your time,
      Tumma K.
    • By MrEddByrnes
      I'm hoping my question can have a happy ending. In the mid-90's, I purchased Filemaker 3. When Filemaker 5.5 Pro was released, I bought the update CD, which requires the user to either have FM 3 installed or to have the installation CD for FM 3. I've used it all these years, most recently with Windows XP Pro, and it has worked just fine. The databases I began with were long ago converted to FM Pro 5.5 databases.
       
      I'm still using FM Pro 5.5 on a laptop with WinXP Pro, but in 2013, I purchased a PC with Windows 8. I haven't been able to install FM 3 on it, therefore can't install FM Pro 5.5. I am retired and rarely use Filemaker, but I have a few Filemaker databases I'd like to add to my Win 8 machine. I don't feel it's worth upgrading FM for the sake of using a couple of databases.
       
      Has anyone else run into this situation and/or have a (possible) solution? Is there perhaps any other software that can read FM 5.5 databases? Thanks in advance for your help.
       
    • By bmill
      I am using a custom filemaker solution for medical office billing written with fp5 running on a mac with snow leopard. In addition, I have a patient management db (which I wrote) that is linked through pt. ID number to the billing program allowing transfer of some demographic information (name, DOB, etc).
       
      Other than being limited by hardware restrictions, the billing program serves our needs for now and upgrading to fp12 will take some time (and money).  In the meantime, I am upgrading my pt. management program to fp13 and would like to move new patient demographic information from the billing program ( fp5 running on snow leopard through Parallels) and the new pt management program ( fp13 running on OS X 10.9) on the same mac.   
       
      Ideally, demographic information would be entered once into fp5 and then a scipt would make the data available for fp13.
       
      Any ideas on how to make this work?
    • By randyinla
      Hi, can anyone tell me why my on-line database might have stopped allowing me to delete records?  All of my access privileges and passwords are correct.
       
      thanks!
    • By randyinla
      Hi, I still use filemaker 5.5 and am very happy with it and don't want to upgrade.  Does anyone still host filemaker 5.5?  Thanks!
×

Important Information

By using this site, you agree to our Terms of Use.