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

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

Recommended Posts

  • Newbies
Posted

I have a database of projects with one of the fields being a "status" field with "completed" as one option. Is there a way to copy a record that is completed to an archive database and then delete the record from the current database?

Posted

Script in your Main file would be something like:

Set Error Capture [On]

Allow User Abort [Off]

Enter Find Mode[] ... unclick pause

Set Field [status, "Completed"]

Perform Find [ReplaceFoundSet]

If [not Status(CurrentFoundCount)]

Show Message [button: OK; Message: "No Records Found"]

Show All Records

Halt Script

End If

Perform Script [External, (select your archive db here and specify an import script which you will create in your archive file first)]

Delete All Records

Your import script in archive would be:

Import [Restore, Perform without Dialog] ... select your Main file

Show All Records

With this in place, Mike, you will execute your script in Main, it will find all Completed Records. With the found set isolated, it would then open your archive file and pull (import) only the found records from Main. Your Main script would take over again (which would return you to your Main file) and delete the found set. When the found set is deleted, you will be left on record 1 with all remaining records displayed.

If you only wish to archive one record - the one you are viewing, it would be the same basic process but you would not use Find. You would Show All Records, Omit the current record, then Show Omitted (thus isolating it as the only record in a found set), then perform your External script. And you probably would want to add a test to be sure the status is Completed right before performing your External script. Where the If[] is above, instead use: If[status, Status <> "Completed"] ... Show Message ... "You can't archive an Incomplete record." etc.

Always back up before trying something new.

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