Jump to content

FM12 Not performing 'mass' deletion?


ron G

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

Recommended Posts

I have this script sequence:

 

post-72145-0-32535400-1361695833_thumb.j

 

It uses this layout :  _global

 

post-72145-0-32599200-1361695855_thumb.j

 

Here is the structure:

 

post-72145-0-85487700-1361696251_thumb.j

 

For some reason (therein lies the problem) accessing this layout and issuing the 'delete' command does not delete the Lodge Name, address, address2, phone and a few other fields.  But, it does delete 95% of the fields.  (The  Phone has auto enter calculation.  But the addresses are regular global fields).  I think FM does not import calculated fields but does an autoenter calculation qualify for that exclusion?  Also, why don't the address fields get deleted?  I am perplexed.

 

What am I missing?  I can't see it.

 

Update: I just stepped through script and every other _layout worked perfectly.  The code to delete all records in each layout is the same.  So, somehow it is the layout?

 

Thanks

 

Ron

Link to comment
Share on other sites

Your script is deleting the records, but it cannot remove the content from global fields. Global fields will persist even when there are no records in the file - that is one of their key features.

 

Re-examine why you created the address fields as globals.

Link to comment
Share on other sites

"... can not delete the content from global fields".   hmmmmm.... I read something similar in Feiler's "FM In Depth".  I wonder if I can use a Replace to effectively remove the content of the global fields?  (Surely there is some kind of workaround for deleting global field contents?)

Link to comment
Share on other sites

It isn't clear what you're doing or why; but you misunderstand the nature of global fields.

 

There is only one instance of a global field and that instance exists whether you have any records in the table or not.

 

You only need to use set field. Your script needs to do this for each field you wish to clear.

 

Set field [ gDate; ""]

Set field [ gSomethingElse; ""]

Link to comment
Share on other sites

Although you might clear the data as BruceR shows, also be aware that the data is only cleared from the context of the user who cleared it. In a multiuser setup each user has their own instance of the global fields and their values. This behaviour is the different with conventional fields where each user will see the changes made by any other users immediately.



(Surely there is some kind of workaround for deleting global field contents?

 

Not as far is I know - but I wouldn't use global fields in this way, and wouldn't need a 'workaround'.

Link to comment
Share on other sites

  • 1 month later...

March 29

Continuing.....I just reread what was previously submitted... And, it makes a lot of sense.  Thanks

 

But, the current problem is this:  I have version 21 of my program.  Version 21 has sample data.  When a prior user gets v21 they need to erase all the 'sample' data and import their 'real' data from version 20.   I have written the script to delete the tables and then 'add' the target tables and it works great.... Except for my global table.  When I import and ADD, I ultimately end up with literally thousands of records. 

 

post-72145-0-42747900-1364626255_thumb.j

 

Question:  "What is the best way to import the global records from v 20 into v 21???

 

Thanks for your ideas...

 

Ron

Link to comment
Share on other sites

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