• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 373
  • Last Modified:

Disappearing Records-date changes

My question is as follows:.
We are using FIlemaker Server and FIlemaker 6.0 for our clients.

Ocassionally, we have records that we know were in the database the day before disappear and no where to be found.
Also, some of our dates change automatically and we don't know why.
For example: We have a field called INvoice sent date which is a calculation- If (Invoice sent = "X", Today," ")
We actually put an X in the invoice sent field which the trigggers Invoice sent date.
The field option do not evaluate if reference field is empty and we have indexing on.

I didn't think that the today function recalculates each day. We use the invoice sent date to perform other functions and do not want it to recalculate each time program opens?

DO you have any suggestions? APpreciate your help
  • 3
  • 2
2 Solutions
When you say the records disappear, is it that you can't find the records based on values you expect them to have, or is it that the record is actually deleted?

There is a known bug with the today() function, and you should use the Status(CurrentDate) function instead. It's possible that bug could have something to do with your problem, but from what you have described, I would expect the Invoice sent date to change if the record is altered.That could also be causing your problem.

In this case, you would probably be better off using a regular date field instead of a calculation, and use a script to set the date field when someone clicks in the Invoice Sent field. That way you have more control. When the X value changes, you can check to see if there's an existing date already, and prompt the user to be sure they really want to make the change.

It's also possible you could have a corrupted database, but I not try doing any sort of recovery until after you have fixed the date issues and see if that resolves the problem.
kcassoneAuthor Commented:
Yes, I am told the records are actually deleted.

Are you saying the invoice sent date should change if any of the a record fields change or if only the INvoice sent and invoice sent date change?

Usually when some one changes the information incorrectly a ? appears in the field.

The reason why we want to use an automatic calculation field is because we have users that forget to fill the required fields in properly.

It's very strange because when I look at lst nights back up the invoice sent date is 4/19/05 but today the date is 4/15/05. It really doesn't make any sense to me.

What is the bug for the today field that you are talking about?

Records getting deleted: never seen this, somebody deletes them, maybe not on purpose! a side effect?
Change rights to disable records deletion in this table and see if it still happens or if there is a script which complains, you might catch the guilty one this way.

Now function: there is no bug to me, it's just a matter about how you expect it to work: the way you've done it, it will change the date everytime this record is displayed: a calculatied field is dynamic by definition.
The controversary about "Now" is that it used to miss updating at midnight in fm4, you had to close and reopen the database to get its value updated. A bug for overnight workers.
To fix yr problem, you can for instance have the operator to enter the X in a dialog window shown by a script (set the X to be a button)
1 check if the X is entered or not
2 if empty, show dialog, do you confirm invoice is sent? if yes enter the X and the date value in appropriate field.

Bill, congratulations for becoming Master! I can take some holidays now!
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

You should probably confirm for yourself that the records are really deleted. My experience is that generally records aren't really being deleted, they are just not showing up in the expected location. If users generally work with a found set or portal for example, and something changes in the records so that they no longer match the criteria, then they will seem to have "disappeared" when really they are just not showing up in the expected place.

I assume you have some sort of auto increment field as a primary key. Show all records in the table, then sort by this value, and look for gaps in the sequence.
For example, if you see the sequence 4005, 4006, 4007, 4012, you can tell that five records were created and then deleted. There will probably be a few such gaps here and there, but if you don't find lots of them, then your records are probably not being deleted.

Try to pin down when the records are disappearing. Have folks keep count of how many records they enter each day, and check the total number of records in the table at the end of each day. If the numbers appear to change at a time that nobody's using the database, then you may have a corrupted file.  In that case, make sure you have multiple good backup copies of the entire database, then try running a recovery on the file in question.  

The old Today function in FM4 was a bug, because it didn't work the way the documentation described. Rather than fix the bug, FileMaker just changed their documentation to make it sound like it's that way on purpose. It's stupid though, because if you don't restart the database every day, you get inconsistent behavior. In your case, you'd have to restart the FM server each day to ensure Today works properly. Nobody really uses Today for that reason. In fact, in FileMaker 7, the Today function has been removed completely.

"It's very strange because when I look at lst nights back up the invoice sent date is 4/19/05 but today the date is 4/15/05."
This could be the Today problem. When you open the original file hosted on the server, it still shows the date from several days ago, because the file has not been closed and reopened. (It has to be closed and reopened *on the server*) But if you open a backup copy, *that* file *has* been closed and reopened, so it updates. That might explain your experience.

Using a plain date field instead of a calculation doesn't mean you can't fill the date in automatically. You can still do this with a script.

Instead of having the user type an X in the text field, create a checkbox field, and make it into a button that runs a script. Then, when someone clicks on the check box, the script can change the value of the checkbox field, so an X appears in it, and also apply the date value to the date field at the same time. The advantage of this is that the date value will not change as a result of someone fiddling about with other fields, or doing a replace, import, etc. The script can also do other things like pop up a warning message if it's a slow paying client, etc. Another big advantage is that you can manually correct the date if it accidentally gets changed.

Lesouef: Thanks! I feel a whole lot smarter somehow...

kcassoneAuthor Commented:
I just can't get either of your suggested calculations to work.
Can you please give examples of scripts so date automatically updated in a invoice sent date when you put an X in the invoice sent field. I tried to use the Status(Current Date) function but could not get it to work as well as the check box scenario.  I do not want the invoice sent date to change.
Here is a simple demonstration of the concept.

Click the check box field.
The field is actually a button, which runs a script. The script checks to see if the box is already checked. If it isn't, then
the script changes the checkbox to checked, and stores todays date in the date field.

If the box IS checked already, then it looks to see if there's a date in the field. If there is, it asks the user if they are
sure they want to clear it. If they say yes, it clears the date AND the checkbox.
If they say no, it doesn't do anything.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now