Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Clearing Values in Layouts


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

Recommended Posts

Posted

I have a Database that does calculations and displays data for a report. I have a script that does a "Delete all Records" at the beginning so the old report is cleared out, and re-imports data for the new reporting procedure.

The problem is that even if there are no records, my Layout is still reporting values in some variables just before I import data. Most reports do not use all the Display variables I have so these "no data" values are still showed.

Is there anyway (other than a script step that sets all these fields with nulls and zeros. And I'm not sure that will work anyway because there are no records in the DB when I need to set values) to do this?

Thanks.

Posted

The problem is that even if there are no records, my Layout is still reporting values in some variables just before I import data. Most reports do not use all the Display variables I have so these "no data" values are still showed.

I am not sure what you mean by this. Please provide more information. Are these calc fields that you are seeing this in? Are they related fields? etc?

Also did you do a show all records before deleting all the records or are you just deleting the found set?

Posted

After doing some more studying, I think most of the fields are both calculations and Globals. The easiest way to re-create this is to make a test database with a global variable in it. Make a few records, populate the global field, and then do a "delete all records". When filemaker shows zero records, you will notice that the global field is still populated. In turn, in my case, if I don't use the global field on the next import (which can be 1000 records or more), it will still be populated with the older number.

Of my calc fields that are exhibiting this, I think they are coming from a related DB but it's kinda the same thing.

Like I said, I could go through and set fields, but I'm not sure that will work because I have no records at the very beginning and I have about 50 fields to set so I thought there was an easier way to "clear the cache" so to speak.

Thanks so much.

Posted

Okay I think you are getting confused slightly on the terminology.

A global variable is not he same thing as a global field. A global variable is a temp storage in the system memory that resides until the file is closed or it is cleared. As opposed to a global field which is a field that can be accessed throughout the system as well the value you set it to clearing out when the file is closed. If the file is being served, a global field will retain its original value it was set at the point when it started being served.

http://faq.filemakermagazine.com/index.php/Global_fields

So id you are hosting these files, you can clear those fields and then start serving. Then whenever you connect to it from a client, it will start cleared. Otherwise, a global field can still retain its value even though the records are deleted.

Posted

Ok, so. What I'm am doing is clicking on the Storage tab when I create the number field and choosing Global. So what is that? Now I'm confused.

But in any case, I guess what the link you sent me to is saying is that I (using a single user environment) am stuck with the Fields being populated with whatever they were before the records were deleted. So I do have to figure out how to clear them with some sort of Set Field Script. That's gonna be tedious. oh well.

Thanks,

Posted

Ok, so. What I'm am doing is clicking on the Storage tab when I create the number field and choosing Global. So what is that? Now I'm confused.

That is a global field.

A global variable is set usually by a script step.

As for clearing out a bunch of global fields at once, here is a link to a really old thread with one technique.

http://www.fmforums.com/forum/showpost.php?post/179234/

Posted

Huh, that's interesting. How come when I erase the record in the DB that you linked me to. All the globals clear out Without using the script, yet if I delete all the records in my db the don't?

Take a look at this test DB I attached. Make a record. Then change the Global then "delete all records" look at the layout. The Global is still populated. :

If you have time. If not you have more than helped me. Thanks!

Test.fp7.zip

Posted

Hmmm... I guess I should have opened up that old file before I posted a reply to you but none the less the technique is the same but in your case it would be for global fields instead. That old sample file used regular fields. I cant remember how many times I modified and uploaded a new file for the poster. Basically, they are not global fields and therefore when you delete all the records, the values disappear.

This topic is 6059 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
×
×
  • Create New...

Important Information

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