MayFlower develops specialty software products for Lotus Notes & Domino.




Chapter 3 - Example #1a: Loading Response Documents
Table of Contents


Creating Response Documents with Sentinel

This example demonstrates the use of Sentinel to create Response Documents using Key Field values. A Contact Document will be created as a Response Document related to the Customer Profile Document in the database.

Open the Sentinel Tasks Database
1. Double click on the Sentinel Tasks icon in the Notes Workspace.

Navigate to the Task Document View
1. Switch to the View titled 1. Task \ 3. Task Type. This View lists all Task Documents you create. The Task Documents you created in the preceding examples are visible in the View.

You will now create an ASCII Task Document to load the C:\Sentinel\Contacts.sdf source file as a Response Document in Customer.nsf.

Creating an ASCII Task Document in the Sentinel Task Database
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 Document
1. Enter the Name or Title of the ASCII Task for display in the view. The title should reflect the nature of the data file (i.e. Contact Profile Response for the example we will use). Enter Contact Profile Response now.

2. Enter a description of the ASCII Task. The description should accurately describe the ASCII File (i.e. Loads Contact Profile Form in Customer.nsf from Contacts.sdf for the example we will use). Enter Loads Contact Profile Form in Customer.nsf from Contacts.sdf now.


Source File Information

Use this section of the form to identify where the Source File is located.

1. 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. Enter the File Name you will load. In our example, we are loading Contacts.sdf. Enter Contacts.sdf now.

3. ASCII Type. Indicate the ASCII Type of 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 length defined format. Select Length Defined now.
ASCII Type Length Defined

4. Record Delimiter. Form Feed or Other. Make sure the Form Feed 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, type and length with a colon. In our example, we will be loading the Contacts.sdf Source File which is length defined. Enter the following values for Field Types now:

CompanyName:Text:30
ContactName:Text:30
ContactTitle:Text:30
ContactPhone:Text:20
ContactAddress:Text:30
ContactCity:Text:20
ContactState:Text:2
ContactZip:Text:5



Notes Destination Information

Use this section of the Task 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 complete Path and File Name of the Notes Destination Database. In our example, we are loading a Response Document into the Customer.nsf database. Enter C:\Sentinel\Customer.nsf in this field.

3. View Name: Every Notes Destination Database must have a view to load data into. Enter Contact in the View name field.

4. Key Fields. Enter the Response Document Key Field(s). For our example we are loading a Response Document titled Contact Profile and the Key Fields are CompanyName and ContactName. Enter Company Name and ContactName now.

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 Response Form with the Alias Name Contact. Enter Contact in the Form Name field.

6. 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 loading a Response Form titled Contact Profile. Select Response now.

7. Keys Fields to Main Document
Enter the Keys Fields to Main Document. For our example we are loading a Contact Profile Response form associated with CompanyName. The Parent Key Field is CompanyName. Enter CompanyName now.

Keys Fields to Main Document
CompanyName


8. Import Type: You are loading a Contact Profile Form that is a Response Document associated with a Parent Document titled Customer Profile. We want to load all of the records from the ASCII file into Customer.nsf. Deselect the default choices by clicking on them with the mouse and check the box next to Add Unique and Update now.


Task Option

1. 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, we will use All Messages. Make sure All Messages is selected now.

2. Notes Formula: Enter any Notes formula(s) you wish to run on the data prior to loading it into the Notes Response Document. For our example we will not be using a formula. Leave Formula Blank.

Saving the ASCII Task Document

1. Press the Escape Key and then press the Enter Key to Save the ASCII Task Document

2. The ASCII Task Document is now available in the 1. Tasks\3. By Task Type View .

J Tips & Techniques

Prior to loading an entire data set, we recommend making a copy of the Notes Destination Database and run a limited number of records by selecting the Limit Import choice at 20 to 30 records. This will test the accuracy of the names, type, and length specified. After you have specified the field names, type, and length and completed the Task Form, run a test load and check your results prior to loading the actual Notes Destination Database with the complete file.



Running the Task

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, there will be several new Contact Profile records in the database. Highlight a Contact Profile record and press ENTER to inspect the data load.

4. From the Main Menu in Lotus Notes, change to the View titled 3. Logs\1. Messages By Time

5. Press Enter to inspect the activity log document and view the load results message.

6. 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.

7. If the load was not successful, chances are a very simple mistake in syntax occurred when you created the Task Form. Enter the Sentinel Task Database 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.