You are on page 1of 5

1/27/2011

Written by Bob Flanagan

CounterPoint/PeopleSoft Interface
AMS Retail Solutions
CounterPoint/PeopleSoft Interface
Version 1.0

OVERVIEW
This application is intended to import employees from PeopleSoft into CounterPoint on a nightly basis
and exports employee purchases to PeopleSoft every two weeks.

TECHNICAL DETAILS
Command line arguments
CpPsInterface.exe <User> [AutoRun] (e.g. "CpPsInterface.exe MGR AutoRun")

Configuration file settings


Key Description
ImportDir This directory is where PeopleSoft should place their import file
nightly. Example: "C:\CpPsInterfaceData\Import"
ImportArchiveDir This directory is where imported files get moved to after a
successful import. Example:
"C:\CpPsInterfaceData\Import\Archive"
ImportErrorDir This directory is where import files get moved to if they cannot be
imported. Example: "C:\CpPsInterfaceData\Import\Error"
ExportDir This directory is where export files get created every two weeks.
Example: "C:\CpPsInterfaceData\Export"
EmployeeImportFileMask Used to read the import files to process (e.g. "Employees_*.txt")

The export files have this naming format based on when the program was run:
EmployeePurchases_YYYYMMDD_HHMMSS.csv (e.g. EmployeePurchases_20110102_183900.csv)

The import files should have a similar naming format:


Employees_YYYYMMDD_HHMMSS.txt (Employees_20110102_123200.txt)

Database config settings (TAEP_CONFIG)


Field Description
TemplateCustNo This field contains the customer number of the template record
used by the program to create a new customer. The values in this
record are used to create a new customer and then the
information from the export file updates the corresponding fields.
2 www.techacumen.com ■ 818-353-4111
2222 Foothill Blvd ■ Suite E-351 ■ La Canada, CA 91011
CounterPoint/PeopleSoft Interface
Version 1.0

UserId Used to mark application tables when doing inserts and updates.
NextPeriodStartDate Used when creating the employee purchases export. When
running automatically, the program checks to see if the current
date is later than the end of the period which begins on this date.
If so, customer purchases are exported and this field is set to the
first day of the subsequent period. This field is not affected when
running the field in manual mode. This field must be manually set
initially for the first period where an export is desired.
DaysInPeriod This is the number of days in a period. It is used along with
NextPeriodStartDate to calculate the starting and ending date for
the employee purchases export.

Stored Procedures
Name Description
TAEP_InitPeopleSoftEmployeeImport Prepares for the Employee Import. Verifies the
config file is present and needed fields are
populated. Sets employee customers to not
allow tickets.
TAEP_ImportImployeeFromPeopleSoft Inserts a record into the import history table.
Creates/updates customer information from
Import file.
TAEP_InitPeopleSoftEmployeePurchasesExport Prepares for the Employee Purchase Export.
Verifies the config file is present and needed
fields are populated. Calculate starting and
ending dates for automatic mode. Does error
checking for parameters enetered with the
user interface.
TAEP_ExportEmployeePurchasesToPeopleSoft Used to create the employee purchases export
file. In automatic mode, sets the
NextPeriodStartDate in the database config
file.

Tables
Name Description
TAEP_Config Described above.
TAEP_PeopleSoftEmployeeImportHist History file that keeps detail records of all
employee import history.
TAEP_PeopleSoftEmpPurchExportHist History file that keeps detail records of all
employee purchase export history.

3 www.techacumen.com ■ 818-353-4111
2222 Foothill Blvd ■ Suite E-351 ■ La Canada, CA 91011
CounterPoint/PeopleSoft Interface
Version 1.0

INSTALLATION AND CONFIGURATION


1. Run script(s) in the table directory.
2. Run script(s) in the Functions folder.
3. Run script(s) in the Triggers folder.
4. Run script(s) in the Sprocs folder.
5. Create a template customer for the employee customer import in CounterPoint customer entry.
Any values you enter here will be used for the new customers created unless overridden by the
values in the import file.
6. Populate the database config table (TA_Config) using SSMS or whatever. Fields are explained
above. After you have created this table, you might wish to add a custom form in CounterPoint
to maintain it with lookups into the Customer table and Customer category table. Don’t allow
the RecId field to be entered and set up the menu selection for update only (no insert or delete).
7. Create a folder for the C# program. We recommend that you create it off the root with no
spaces in the name for easy access.
8. Unzip CpPsInterface.rar into the new folder you created.
9. Open up CpPsInterface.exe.config with a text editor (if it highlights xml syntax, that would make
things a little easier.
a. Ignore the database settings; the program will walk you through that the first time you
run it.
b. See section above for application specific settings.
c. Modify the SMTP server settings to use the client’s smtp server (or set one up on gmail
if you like) so that you can get email alerts if the program generates exceptions. You can
enter as many email addresses as you want. It would be a good idea to leave our email
addresses there.
d. We use log4net for logging errors, etc. You can google this to get all the information
you want about how to configure it. Currently it’s set to keep a log file in the application
directory with a default level of DEUG; this provides much more information than INFO.
You will probably want to change it to INFO when the program has been reliable in
production for a while. You can delete the file any time the program is not running and
open it with a text editor to see what’s going on. This is the first place you should go if
there are any issues.
10. PLEASE NOTE THAT THE C# PROGRAM CANNOT BE RUN OVER THE NETWORK. YOU HAVE TO BE
LOGGED INTO THE WORKSTATION THAT IS USING IT EITHER AS A LOCAL USER OR OVER
TERMINAL SERVICES. YOU CAN RUN IT ON THE SERVER OR ON A WORKSTATION.

4 www.techacumen.com ■ 818-353-4111
2222 Foothill Blvd ■ Suite E-351 ■ La Canada, CA 91011
CounterPoint/PeopleSoft Interface
Version 1.0

11. To start the program manually, just double click on the executable and you will get a login
screen. We honor CounterPoint users and passwords. Running manually is self explanatory as
you will see when you open it up.
12. Here is a sample of how you can run the program in automatic mode from a command prompt,
in a batch file, or using windows scheduler. CpPsInterface.exe MGR AutoRun. This script
assumes that you are in the application directory. I’m sure you know how to specify working
directories, application directories, etc. using shortcuts and/or windows scheduler.
13. Please let me know if you have any questions.

5 www.techacumen.com ■ 818-353-4111
2222 Foothill Blvd ■ Suite E-351 ■ La Canada, CA 91011

You might also like