Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

FM12 Not performing 'mass' deletion?

Featured Replies

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

Solved by bruceR

Go to solution

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.

  • Author

"... 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?)

  • Solution

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; ""]

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'.

  • Author

Worked great Bruce.  Thanks...

  • 1 month later...
  • Author

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

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.