Working with File Delete Record Process

Navigation:  How to Work with Processes > Working with the Data File Processes Group >

Working with File Delete Record Process

Previous pageReturn to chapter overviewNext page

 

Process Purpose

 

The "File Delete Record" process is used to delete one or more records from a specific data file.

 

 

When you add a process, you are required to define its settings. This occurs in the process's properties window which is displayed automatically after having added the "File Delete Record" process.

If any subsequent edition is required, double-click the process to open its properties window and enter the necessary modifications.

 

 

Proceed as follows:

 

File

File Name

Select the data file that contains the record(s) to be deleted from the drop-down. If necessary, click to edit the selected data file. See Editing a Data File.

This button only becomes active after a data file has been selected. It opens a "Condition" window with the purpose of specifying which records to delete.

See Detail of the "Condition" window.

Store Number of Deleted Record(s) (Optional)

Variable

Click and select the variable that will receive the "number of deleted records". See To Select/Create a Variable.

If Record Not Found

Go to

Select a destination from the drop-down or the list, in case of a “Record Not Found”. See Detail of a window below.

 

When defining a screen as a target destination (ex: via a “Go to” process), you CANNOT use variables to specify the name of that target screen. You must select the intended screen from the available drop-down/list.

 

 

Detail of a window:

 

 

"S:Menu" is a screen included in the same program as the process.

"R:Routine_1" is a routine included in the same program as the process.

 

If required, use the icons on the upper right corner of the process properties window:

 

Click this icon to create a new data file. Go to Creating a Data File to see how to fill in the several options available.

 

Use the icon to attach any relevant notes to this process. Click it and enter your notes in the resulting text box. These notes will be displayed in the corresponding "Actions" tab or "Process" window (in the "Notes" field) and in the "Developer Report".

 

 

After filling in the required options, click to conclude or to abort the operation.

The added process is displayed in the corresponding "Actions" tab or "Process" window.

 

 

Detail of the Condition window

 

 

Fill in the following options:

 

Conditions

Search criteria

Select the search criteria from the drop-down (which record(s) to delete). If you select “Record Number”, it activates the “Record #” option.

Record Number

This option is enabled if the selected search criteria is “Record Number”. Define the number of the record to be read OR  click and select a variable with the intended value. See To Select/Create a Variable.

 

Before defining "record number" as a search criteria, consider the number of records involved - it may have a performance impact, in terms of speed. To improve performance, we recommend a data look up based on field values (ex: "Search criteria" - "first record" / "Where Field Name" - X  /"Equal Value" - Y).

 

Conditions

Where Field Name column

Specify the field name to be used to match the search criteria, through a "Where" condition, from the drop-down.

Equal Value column

Define a value to search. Either enter it OR  click to select the variable with the adequate value.

Partial column

Check the “Partial” option, if the purpose is to include a partial string value from the beginning of the string to be searched and not just the complete string value in the "Where" condition.

 

If your project requires the use of partial string values that are not necessarily located at the beginning of a string, we recommend you use the Local Database to manage the data instead of a data file. See Working with the Local Database Processes Group.

 

 

Use the editing icons to the right of the table to move the rows up and down and to delete or add more rows.

 

Click to apply the options that were filled in and go back to the properties window of the "File Delete Record" process.

 

 

You can use relative paths to refer the file(s) you want to use in your project. See Working with Aliases.

 

 

If you want to use a label as a target destination, you can use the "Auto-Label" mechanism. This alternative to the "Set Label" process allows you to create a label in the properties window of a process - specifically, in the fields used to define target destinations (ex: the "If Error..." type fields). See To Automatically Create a Label.

 

 

Use the right-click in MCL-Designer's input boxes to access some related options as well as the general "Cut", "Copy"; "Paste"; "Search" actions (active/inactive according to the current context).

Ex: If you right-click the "Variable" input box (included in a "Conversion's" properties window), you are provided with general editing/search actions and other more specific options such as "Variable Select" (see "Variable Select"); "Variable Insert" (see "Variable Insert"); "Insert Special Character" (see To Insert Special Characters into a Control's Text Input Field) and "Localization Select" (see Localization List).

If you right-click another input box, it may provide other possibilities.