MoveFile-Copy File Enter Utility


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]

Posted by Jon Sacks on June 16, 2008 at 17:33:01:

There is a need to have Comet data delivered to other systems in a seamless manner without a QDIR. The tools are in place in Comet to allow this to happen, but it did not come together in a single place. With the elimination of the N type directory in the current version of Comet, I created a utility to allow you to place files created inside Comet anywhere your client has access to outside of Comet.

As an example, you may choose to create a CSV file with the report generator but want that CSV file in the accounting departments folder on another public File Server (i.e. not the comet server).

Or you may want to have the data end up in the users my documents folder as in the following example.

Using the utility you simple write a record to the system buffer in the format of:

Source File Name,[DIR],Destination File Name,Alias,EraseFlag,LauchFlag
Example testfile.txt,tmp,testfile.txt,mydocs,Y,Y

Then ENTER MOVEFILE and the file will move to the local users folder assigned to the “Alias” mydocs.

IB Code
Msg$='testfile.txt,tmp,testfile.txt,mydocs,Y,Y'
PRINT (#) Msg$
ENTER MOVEFILE

The program works just as well on remote systems via Comet Anywhere. It senses that a user is an anywhere client and executes the Copyfile to the remote machine with the progress meter for the user.

It also allows you to specify if you want to Launch the file after delivery.

The new Report Generator now supports a new command ENTER. So you can specify in your report generator specification to create the CSV, ENTER MOVEFILE, Move the file to the remote users machine, erase the file on the Comet Server then launch the file to Excel.

Sample Report Generator Spec:

ERASE AR.CSV,TMP
PRINTER AR.CSV,TMP,H
INPUT RECEIVABLES
SELECTING IF PAST.DUE.AMOUNT GT 500
PRINT CUSTOMER.NUMBER;INVOICE.NUMBER;INVOICE.DATE;PAST.DUE.AMOUNT
ENTER MOVEFILE,UTL,AR.CSV,TMP,AR.CSV,MYDOCS,Y,Y
RUN Z

This will create an extract move it to the remote machine, erase AR.CSV on TMP and Launch the file to the associated program for the .CSV extension.

In this implementation it was my idea to have the file names in the application program static, such as mydocs, but the user could choose where they want mydocs to go by establishing the Alias on their system. So one user may want the data in c:\comet\mydocs or another user may want the data in mydocuments\cometdata. The use of the Alias gives the end user final control.

Notes:

1. You must have the Alias assigned for the destination in the Comet Client Edit/Directory Alias. The user must have OS level access to this folder in order for it to work.
2. I built this around the report generator so the code mimics what is done in the display by doing a roll-up of the screen. I didn’t create the method I’m just conforming since moving the display to normal mode or typewriter mode whacked the screen on the exit back to the report generator. It would be nice to have someone display the progress in a child window.

Give it a try.

JSACKS<<
If you’re not the lead dog, the view never changes!



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

What is the name of the main Signature System's Product?  

Comments:

Optional Link URL:
Link Title:
Optional Image URL:

You may attach up to 5 files to your followup (see below):





Each file can be a maximum of 1MB in length Uploaded files will be purged from the server on a regular basis.


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]