Emailing pdf files

Godfather

Member
Hi
I am trying very hard to email .pdf files produced by UBE's. I have got the email going (willing to share that and anything else) but I cannot find the Job Number on which the .pdf file name is based. I have looked in lpBhvr but nothing seems to be plugged.
Can anyone help, please?
 
Have you tried looking in the F986110 table - displays inyour Work with submitted jobs application
 
Certainly have! The problem there is that the job number is already known. I want to find out the job number for the UBE that I am actually in so that I can send the email from the Report End event.
Thanks
 
Richard,

I've been down the same road in the past . . . Reached the roadblock of not only the file name but that (at least on a UNIX server) the file resides as a temporary file (like AF000009) in a temp directory until the report closes. Also did you notice the "Report End" event has "(future)" as part of its name? Unless you can confirm otherwise my assumption is that this event does not really fire yet.

The best solution I've seen posted here is to put a table trigger on the F986110 table that looks for files with a specific name/version. You have all the information needed then to email the file. Unfortunately this approach only works with submitted jobs . . . :(

Regards,
 
But from when your UBE becomes active, and the F986110 record status has been updated to 'Processing' has the job number not been updated also?
 
are u trying to automatically distribute email once the ube is finished

or

email them manually pdf resides in the printque:
C:\B7\PrintQueue
 
If the job is on a single threaded que, somewhere in the Page Header, fetch the F986110 record of the processing report and get the full file name. Then in the Report End (FUTURE) event, you could send the email. The Report End does process and the PDF is generated by the time it's fired. Or, if you don't have any parameters to pass through report interconnectects, you could use jdeLaunchUBE. Look at the source file for B91300C. Search for that API and you'll see the only example I know of that jde returns a job number of the called report.
 
Thats good news Casey - I'll have to revisit this is some of our UBEs now!
 
Godfather,
I dont know if this helps, but for server jobs the number of the job is feched from the F986111 table for the server map it runs against. There is no next number for it, but this table contains a job number that increments when a job is run against that Logic server, therefore it is possible to obtain the job number before the UBE completes.

Example - Record in the F986111 is as follows:
JCJOBNBR = '2056'
JCEXEHOST = 'JDETESTOR1'

The UBE "R09801" version "WUK0001" is run and the name is:
R01403_WUK0001_2058_PDF (It skips one number each time its run)


If you have the time and the inclination I would like to know how you are sending the PDF's... (I am well versed in workflow e.t.c.)

If you have any questions about the F986111 please let me know
 
Hi!
Thanks very much for your input. I am not back on site until Monday but I
will give it a go then. T will also send you the stuff on email.
Thanks

Richard Godfrey





I dont know if this helps, but for server jobs the number of the job is
feched from the F986111 table for the server map it runs against. There is
no next number for it, but this table contains a job number that increments
when a job is run against that Logic server, therefore it is possible to
obtain the job number before the UBE completes.

Example - Record in the F986111 is as follows:
JCJOBNBR = '2056'
JCEXEHOST = 'JDETESTOR1'

The UBE "R09801" version "WUK0001" is run and the name is:
R01403_WUK0001_2058_PDF (It skips one number each time its run)


If you have the time and the inclination I would like to know how you are
sending the PDF's... (I am well versed in workflow e.t.c.)

If you have any questions about the F986111 please let me know


_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail



XE NT SQL Serve
 
HI, Did you get this going yet? If you do and could you share your experience with us? We plan to do the same but like to get some input from you first.

Thanks David
 
I agree with you that this is the best approach.

I've tried in the past to search the F986110 table from within the report itself. The problem with that is that it doesn't work with "slave" UBE's that are called synchronusly by other UBE. I found out that the F986110 is written upon the thread completion and therefore is not visible from within the UBE at run time.

Let's assume that the average user does not want to email the PDF when running the job locally (I think it makes sense).

You could then attach the trigger to F986110 on "after record change event". The following could in theory be done:

1- Call JDEGetPDFFile( HUSER hUser, const char *pszRemoteHost, /* INput parm */ int jobNbr, /* INput parm */ BYTE *pszLocalFileName, /* OUTput parm */ PDFStatus *eRetCode); /* OUTput parm */
2- Fetch the recipient's address based on whatever criteria in the job (user, environment, report name). You could use the electronic address from the Who's who entries of the address book to store the addresses for non OneWorld contacts, or fetch the user's preference if emailing only to OneWorld users.
3- Email the file as many times as you want!

I don't know if the PDF name function gives you the full path. If not, you could also use the following API to get it:

JDERTN(void) JDEWINAPI GetPrintQueueDirectoryPathName( char * pcPrintQueueDirectoryPathName );


Please keep us posted!

Sébastien
 
Back
Top