Jump to content

My Inexperience comes back to haunt me


This topic is 5785 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Ok, so I am trying to make some changes to a database I made years and years ago when I was inexperienced. Now what I did was use the following calc (that I got from someone on here) to create unique IDs:

Right( "000000" & Status(CurrentRecordID), 6 ) & "-" &

Right( "000000" & Status(CurrentTime), 6 ) & "-" &

Right( "000000" & Status(CurrentDate), 6 )

The problem is that instead of doing it in a text field and making it an Auto Enter Calculation, I actually put it in a Calculation field, which has worked up until now.

The people that use the database have requested a function to duplicate records, so I started working on creating it for them. The only problem is, when I duplicate a record it doesn't give that field a new unique ID because it is not an Auto Entry field. And because it is a calculation field I can't change it.

Any suggestions to how I might do this? What would happen if I changed the field to an Auto Entry text field now? Would I lose all the info that is already in there?

Btw, still using Filemaker 6.

Link to comment
Share on other sites

Make a backup of the file, then try changing it to an auto-enter calc. If I recall correctly, the existing values should remain. If it doesn't work, you can alwasy go back to the backup, add another field to temporarily hold the current IDs, change the ID field, then restore the values.

Link to comment
Share on other sites

Until it was possible to script the next serial number i used to use the following key:

gFile_ID: a unique id for the file (CONT for contacts)

Record_ID: as discussed

Current_Date

Current_Time

Random_Number

gFile_ID & Record_ID & Current_Date & Current_Time & Random_Number

I'm sure its possible to get two of the same values but the odds must be pretty enormous, i never got a duplicate and had used it for 5 Years.

Link to comment
Share on other sites

Status(CurrentRecordID) is really not a good way to assign unique IDs. If you'll ever need to export the data and import it into a clone, Filemaker will reset the count. You should switch to auto-entered serial numbers.

well, I was attempting to use the method desribed here; http://fmforums.com/forum/showtopic.php?tid/1472/post/1472/#1472

however in my newbie state, I misused it a bit. It is probably more than I need, and a sequential auto enter field would probably do the trick for what I need, but again, I was a newbie and thought I was doing something really cool. There is no way I'm going to go back and change how almost every relationship in my database works though.

Make a backup of the file, then try changing it to an auto-enter calc. If I recall correctly, the existing values should remain. If it doesn't work, you can alwasy go back to the backup, add another field to temporarily hold the current IDs, change the ID field, then restore the values.

I am going to give this a try on a backup copy of my database and see what happens.

--

Anyone else ever have little things like this crop up, where you are just looking at a database you made when you were less experienced and you just go "Oh god, what was I thinking?"

Edited by Guest
Link to comment
Share on other sites

Make a backup of the file, then try changing it to an auto-enter calc. If I recall correctly, the existing values should remain. If it doesn't work, you can alwasy go back to the backup, add another field to temporarily hold the current IDs, change the ID field, then restore the values.

Tested just changing it to an auto-enter calc field on a backup copy of my database and it worked fine, all the values remained intact. Implementing it into my live database a little bit later today.

Thanks for your help.

Link to comment
Share on other sites

I never won the lottery. And that's exactly what you're doing with your data - playing the odds. And every record is a ticket, so the more records you have...

Now i would agree with you, It was a best worse case senario.

I used to go through hell with my solutions before 7... every time i updated my 40 file solution i would have to go through each one and set the next serial manually ... sorry but i just got fed up with serial numbers in the end and swiched to my custom method... it was the couple of times that i forgot one of the databases and ended up duplicates that finished me off.

Sometimes its just a bad idea to give quick fix solutions i know but it worked for me.

Now (7+) of course i would not touch this method but i have no regrets as i had less problems with my method in 6 than the true serial method.

I know you will hate me for that but its true.

VIVA THE FILEMAKER REVOLUTION, VIVA 7/8/8.5

THE SERIAL IS AGAIN THE WAY (for me)

best

Stuart

Edited by Guest
Link to comment
Share on other sites

What are you talking about EMOTIONAL. This was a purely practical consideration.

The person that posted this says they are using filemaker 6.

In some version 6 situations i think that using serials is not as practical as a unique calculated code. (an not all people deal with 100s of thousands of records, so the odds are ridiculous with this kind of calculation). 2 people creating the same record with exactly the same date/time on there clock with the same randomly gererated number and the same record ID. Come on!!!

Its fine in 7/8/8.5 where you can script serial management but 6 fell short.

Of course in a perfect world unique serials are best but 6 and before was not a perfect world.

I had already stated that YOU WERE RIGHT but felt that there was a need to point out some impracticalities of 6 that have now been resolved.

Why do people feel the need to put each other down?

(presumably) Grown-up folks
Edited by Guest
Link to comment
Share on other sites

Well, yes, but technically, if you liked the new FileMaker, you may have said "I like the new FileMaker"... Lol to tell you the truth I'm just poking fun.

I don't think comment is putting any one down. He is simply stating the facts. He has provided the reasoning and for him, the reasonable way - with no risk, would be the only way (even if it takes longer and more issues need to be dealt with) which is fair enough.

If you choose not to use that way and go with a serial entering ... thing ... where there is a 1/1000000 chance, there will be a conflict, and are willing to take that risk because it's acceptable.. that's cool to.

As comment says -- you have the fact's it's your decision, he doesn't really care what you do either way (not emotional).

Link to comment
Share on other sites

I was simply being truthful about my own experiences.

I put the last bit in caps (which is unusual for me) to try and not underplay the importance of serial numbers to a potential Newbie as i knew this could potentially be bad advice if misunderstood.

I think we are on the same team ... but i had to be honest ... just in my nature. good or bad.

Link to comment
Share on other sites

This topic is 5785 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

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