Importing user-entered data into SouthWare files

With NetLink you may allow the user to enter data into an HTML form and then update that data into your SouthWare file.  Examples include order info and comments, name/address info, special notes, etc.  Standard NetLink examples include order entry, creating a service order, changing a customer address, etc.  The only limitation is that the file must be importable via ImportMate II.

Handling this in NetLink involves two different requests:

Input Request - the Form to Submit

This is essentially the same as submitting ranges to ReportMate via a form.  In your form you have form fields that display and hidden form fields such as request ID and session number that will also be submitted.  The form action needs to call NetLink.  There needs to be a Submit button the user clicks on to submit the form data. 

This request is used to submit the data and doesn't really know what will happen to the data.  There is nothing special you have to do in the first request to support the import/update function.

See the example below.

Update Request - the Confirmation and Import Request

The second request does the actual update work.  You need a second request because the data entered on the form is not available until the user submits the form (which is after the first request was processed).  The second request displays a confirmation or thank you page, then processes the submitted data.

When you call the Update request by submitting the form Input request NetLink will take the variables sent and write them to a Fixed Position Text file with record types.  If you defined a special text file for formatting the output data the variables will be output as specified.  If you did not define a special text file all the variables will be output (see the documentation for more details).  If you chose the interactive update NetLink then calls ImportMate II and passes it the information it needs to run the update.

Example - Update Two Fields in the customer file via NetLink

We'll do an example in which we allow a customer to:

  • select whether or not a PO number is required on their orders (a Yes/No flag in the customer record) - the variable name will be "po_required"
  • enter a comment that will be stored in the customer user field - the variable name will be "user_comment"

When the customer submits updated data we will have NetLink automatically update the customer record.  (To keep this example simple we are not showing the current value of the fields in the form.  To enhance this example you would simply run a ReportMate as part of the first request that provides variable values from the current customer record.)

First Request - the Form to Enter the Fields

Here we need a request ID that will display a template with a form page.  We'll call the request "CUSINFUPD" for Customer Info Update.  We'll create a template as shown below that will call the request "CUSINFCNF" for Customer Info Confirmation:

@VAR_INCLUDE_HTML=header.txt_@ @VAR_INCLUDE_HTML=custhdr.txt_@

Do you require a purchase order number to be submitted with each order from your company? Yes
Enter your user comment here:



HTML for Form

Cut this code and paste into a new HTML document.  Edit the hidden form fields and the visible fields as needed.

Second Request - the Confirmation Page and Import process

Here we need a request that has both a page to display and an import process to run.  For our example we'll use the following simple confirmation page text:

Thank you for the updated information.  Click here to return to your Start Page for more options.

In this example the "Click here" link returns them to the customer start page.  You likely would want to include standard header and footer references if you are using these in your site.
HTML syntax for confirmation page

Cut and paste this syntax into a confirmation page and edit the text as desired.

The remaining work is to define the import process. 

  • We'll create a special file named "cusinfo.txt" to tell NetLink how to save the incoming variables that we need for the import:


This tells NetLink to save the value for variable "cust_no" starting in position 5 of the import file, to save "po_required" starting in position 55, and to save "user_comment" starting in position 105.  This makes it easy to define the import.

  • We'll define an ImportMate II format called "MYCUSINF" that updates the customer file (AR01).
    • The file type will be Fixed Position Text
    • The file uses record types
    • The default record type is "DAT" (this is used for all NetLink import files)
    • This is a change-only import format
    • The customer number is imported from position 5
    • The PO Required flag is imported from position 55
    • The user comment is imported from position 105
    • The remaining fields are not changed
  • We create a request type "CUSTINFCNF" for Customer Info Confirmation
    • The template should be the confirmation page we created above
    • Indicate that we are importing form data (field 7)
    • Specify the name "cusinfo.txt" for the Optional Format file
    • Indicate "Y" to Auto Import Data
    • Specify "MYCUSINF" as the Import Format Name


Here's how the process should work:

  • The customer calls for request CUSINFUPD which displays the form page
  • When the customer submits the page the data is sent to request CUSINFCNF
  • NetLink displays the template confirmation page for the user
  • NetLink writes the variables to a Fixed Position Text file in the format you specified in "cusinfo.txt"
  • NetLink passes the name of the Fixed Position Text file and the format name "MYCUSINF" to ImportMate II for updating
  • ImportMate II updates the customer record