Jump to content

Scheduled FMS script not deleting records as expected


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

Recommended Posts

TL; DR: FMS running scheduled script to delete "extra" records, reports success, records not deleted.

-----------------------------------------

I had a persistent problem: people opening a database weren't realizing they were looking at other users' existing records, and were inadvertently overtyping them. (More than half the time that people access this, it's so they can make a new entry.) My solution was to have the DB create a new record each time users accessed it (via a certain layout).

The empty records aren't a problem (because users only access "old" records through a search function or printed reports), so I wrote a script that searches for, and deletes, empty records. The only goal is to keep the chaff from outweighing the wheat. This has worked fine.

When I schedule the script (in FMS 14.0.4.412), FMS reports success, but when I reopen the db on my desk, none of the 'useless' records has been deleted. When I run the same script manually, it runs fine (the records vanish).

The account running the script is a Full Access account, and the script has full access privileges.

-------------------------------------------

The steps involved in the script are (how do you cut & paste a whole script?)

  • - Set error capture on
  • - Perform find on a calc field (flips from 0 to 1 when all three fields are empty)
  • - delete all
  • - commit
  • - show all
  • - go to last record
Link to comment
Share on other sites

Nothing in that description looks off.  What does the FMS event log say when the script runs?

Keep in mind that a scheduled script will open the file and run any and all on-open scripts and those may prevent the actual targeted script from running.  If you have any server-incompatible script steps in that on-open routine then you should branch around those.

Link to comment
Share on other sites

That's exactly it! I was getting so caught up in the "higher order" scripting, I was forgetting that when users open it, they click a button to indicate which interface they want to use. Simple added command going to the right layout did the trick. Thanks

Link to comment
Share on other sites

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