Jump to content

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

Recommended Posts

Posted

In FM6, I have a database file that has two global variables. I set these two to 1 when two different types of invoices are printed. Later when a user wants to move to next billing period, the script checks to make sure that the invoices are printed (checks if these two globals are set to 1) and then moves to the next billing period and sets the two globals to 1.

However, when the user prints the invoices on one day and then tries to move to next billing period on the next day, the script finds that invoice has not been printed (since the global values are lost).

Is there any workaround to retain the global value like copy this value to another database when the file closes and when it is reopened copy it back from the other database. Then, the other database should hold these values in regular non-global fields right? I have another database which contains only one record. But I am not able to figure out how the relationship should be defined between the two tables. Any ideas??

Thanks

Posted

In FM6, there are no variables, so I'm assuming that you mean global fields.

Global fields reset to the values that existed when the file was last closed in single user mode. You shouldn't rely on them from session to session.

The method to use is to have a field (not global) store these values. You can "publish" them to globals by using a set field script step in a script that runs on open (see File Options).

All that being said, I'm wondering why you don't have a field in each invoice that stores whether or not it has been printed. I call these type of fields "flags" and name them, "flag_printed" and it's just equal to 1 if it's been printed. My print script sets it.

Posted

Another way is to break it out into a different table related with the primary key of the userID/Name, allow creation of related record is obviously required to gain writing permission.

--sd

This topic is 6224 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.