In this example, you will update Documents in the Customer.nsf with new information. The Update Feature is designed to update existing Documents in a Notes Application and will not add new Documents to the database if it cannot find a match (based on the Key Field).
J Tips & Techniques
This example demonstrates Sentinel's Update feature. This choice is designed to update existing documents, and will not add documents to the database if it cannot find an existing document to match (based on the Key Fieldsvalue).
This is frequently used to convert codes to fullEnglish descriptions.
The source file need not contain one record for each Notes Document. For example, if you are loading Region, the Key Fields can be designated as "RegionCode". If the Source File has North America (RegionCode NA) and Europe (RegionCode EU) as the only values, then Sentinel will update each occurrence of NA with North America and EU with Europe and will leave the others unchanged.
Note: An alternate way of doing the same thing is to use the Formula section to replace the codes during the import. The following formula would accomplish the same objective:
FIELD Region := @if(RegionCode="NA"; "North America";
RegionCode="EU";"Europe";"Unassigned")
If the number of statements in the Formula is less than twelve, the Formula will run faster.
The Comma Delimited ASCII file that has been supplied as the source file is titled C:\SLSNAMES.CSV.
Open the Sentinel Tasks Database
1. Double click on the Sentinel Tasks application icon in the Notes Workspace.
Navigate to the Task View
1. Switch to the View titled 1. Tasks\ 3. By Task Type. This View lists all Transport Documents you create. There are no documents in the View. You will now create the first one to catalog the C:\Sentinel\Customer.txt source file.
Creating a Task Document in Sentinel Tasks
To compose an ASCII Task Document in Sentinel Tasks
1. In the Sentinel Application, choose Compose....1. Task\1. ASCII to Notes from the Notes Main Menu.
2. The ASCII Task Document will appear on screen.
Naming the Task
1. Enter the Name or Title of the Task Agent for display in the view. The title should reflect the nature of the data file (Add Salesperson Name). Enter Add Salesperson Name now.
2. Enter a description of the ASCII file. The description should accurately describe the ASCII File (i.e. Salesperson Name for each Account). Enter Salesperson Name for each Account now.
Source ASCII File Information
Use this section of the form to identify where the Source File is located.
1. Directory: Enter the name of the directory where the source file is located. In our example, we will use C:\Sentinel. Enter C:\Sentinel now.
2. File Name: Enter the File Name you will load. In our example, we are loading SLSNAMES.CSV. Enter SLSNAMES.CSV now.
3. ASCII File: Indicate the type of ASCII file you are loading. Choices are Structured Text, Length Defined, 1-17-20-n, Comma Delimited, and Primary Key/Body. Other formats will be explained in the Examples that follow. For this example we will be loading Customer.txt which is a Comma Delimited format. Select Comma Delimited now.
4. Record Delimiter. Form Feed or Other. Make sure the Form Feed radio button is selected.
5. Field Types: Enter all of the field names in the document with their type and, if length defined, their length. Separate Field Name and Type with a Colon. In our example, we will be loading the SLSNAMES.CSV ASCII source file which is Comma Delimited. Enter the following values for Field Types now:
Use this section of the form to identify the Notes Destination Database.
1. Server Name: Enter the name of the Notes Server the Notes Destination Database is located on. In our example, we are loading a database that is located on the local drive. Enter LOCAL.
2. Database Name: Enter the full path and name of the Notes Destination Database. In our example, we are loading the Customer.nsf database. Enter C:\Sentinel\Customer.nsf in this field.
3. View Name:In our example, we have developed a View titled Customer in the Customer.nsf Notes Application we are going to load data into. Enter Customer in the View name field.
4. Key Fields: Enter the Key Field Value CompanyName.
5. Form Name: Every Notes Destination Database must have a form to load data into. In our example, we will be loading data into a Customer Profile form that has the Alias Name Customer. Enter Customer in the Form Name field.
Task Options
Use this section of the form to select the different options available for the Task.
1. Document Type: Indicate the type of document you are loading in the Notes Destination Database. Choices are Document or Response. For our example we are going to be Updating the Document titled Customer. Select Document now.
2. Keys Fields to Main Document: Enter the Keys Fields to Main Document. Leave this field blank.
3. Import Type: Indicate the type of transport load you want to run. Choices are Add All, Add Unique, Update, and Sync Databases. For our example we are going to Update a Form in the Customer.nsf database and will use the Update selection. Select Update now.
4. Log Messages: Choose whether you want to see All Messages or Error Messages Only in the Sentinel Event Log (View....3. Logs\1. Messages By Time). For our example load, we will use All Messages. Make sure All Messages is selected now.
5. Formula: We want to convert the information in the Source File to Proper Case. Enter the following Formula:
Use this section of the form to enter any comments or additional information about the Export Task. This section can be very useful to provide a complete explanation of the Task when different groups or teams use The Sentinel Task.
1. Comments: Use this field to enter any comments or additional information about the Export Task. In our example, we will leave this field blank.
Saving the Update Task Document
1. Press the EscapeKey and then press the EnterKey to Save the Update Task Document .
2. The Update Task Document is now available in the 1. Tasks\3. By Task Type view. You can now run the Update Task.
J Tips & Techniques
Prior to running an Update Task, we recommend making a copy of the Notes Destination Database and testing the Update Task. Run an Update Task and check your results prior to executing the Update Task on the Production Database.
1. Make sure that the Customer.nsf Destination Database is open on your Notes Workspace.
2. Click on the Run Button at the Top of the Task Form.
3. Check the results of the load by looking in the Customer Activity application (Customer.nsf) in the Notes workspace. If the load was successful, the Salesperson Names will be present in the Customer Documents. Highlight a Customer Document and press ENTER to inspect the Update Task results.
4. You can also check the results of the load by looking in the Activity Log View in Sentinel Tasks
5. From the Main Menu in Lotus Notes, change to the View titled3. Logs\1. Messages By Time.
6. Press Enter to inspect the activity log document and view the load results message.
7. If the load was successful, the log message will tell you how many documents/updates were loaded and if any errors occurred with any part of the load.
8. If the load was not successful, chances are a very simple mistake in syntax occurred when you created the Task Form. Enter the Sentinel Tasks application in Notes and locate the Task Document. Double check all spelling and syntax and then retry the load. Refer to the Trouble Shooting Section at the end of this manual for more information.