Jump to content
Sign in to follow this  
Ballycroy

Deleting Records

Recommended Posts

This script searches the "Order Entry" layout for Order Numbers for a current Run Date and exports the File.

It then goes to a "SearchResults" Table (which is not linked to the "Order Entry" Table). Deletes Records from previous Searches and imports the the files containing the Order Numbers. Then it goes to "TeamEimages" (which is not linked to the "Order Entry" Table). Deletes Records from previous Searches and imports the the resulting text file from the Send Event command (it reads a folder of images).

The results are compared on the SearchResults layout which is linked to the TeamEimages layout.

Problem:

2 out of 8 weeks the script has deleted a few thousand records from the Order Entry layout, although the Delete Records Command is directed at either the "SearchResults" layout or "TeamEimages" layout.

CheckImages

Allow User Abort [ Off ]

Freeze Window

Perform Script [ "FindRecordsForRunDatePC" ]

Go to Layout [ "SearchResults" (SearchResults) ]

Show All Records

Delete All Records

[ No dialog ]

Import Records [ Source: "filewin:/T:/SOdataFiles/SearchText.

Source field 2 import to SearchResults::Name ]

[ No dialog ]

Go to Layout [ "TeamEimages" (TeamEimages) ]

Show All Records

Delete All Records

[ No dialog ]

Send Event [ open document; "cmd /c dir /b T:" & ""& Quote

Pause/Resume Script [ Duration (seconds);) 1 ]

Import Records [ Source: "filewin:/T:/SOdataFiles/Outputfile.

[ No dialog ]

Go to Layout [ "SearchResults" (SearchResults) ]

FindRecordsForRunDatePC

Go to Layout [ "Order Entry" (SPECIA1112) ]

Enter Find Mode [ ]

Show Custom Dialog [ Title: "Find Records For Run Date"; Message: "This dialog will take the date you enter and find the records.

Note: Date should be entered in the following format: mm/dd/yy - 12/24/6"; Buttons: “OK”, "Cancel"; Input #1: SPECIA1112::Run Date, "Run Date - mm/dd/yy" ]

Perform Find [ ]

Export Records [ File Name: "filewin:/T:/SOdataFiles/SearchText.tab"; Character Set: “Windows (ANSI)”; Field Order: SPECIA1112::Run Date

SPECIA1112::Ad Number ]

[ No dialog ]

Any help appreciated.

Share this post


Link to post
Share on other sites

I am not exactly sure where the issue is but I definately see that you need to put in some steps for error trapping. Currently there are no checks for find failures, empty sets, import errors, etc. I think you should add in a GetLastMessageChoice check as well for your message window.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

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