Hi.
I need an urgent help..
i have to create one batch process(App engine) in which everyday it will fetch all the employees who are getting transfer and it will trigger a mail to them with their transfer details in attachment (pdf )in the same mail .
I know about send mail function through which we can trgger a mail with a general attachment.but how to fetch dynamic values for each and every employee in the attachement (pdf),i have no idea.
Kindly help me out.
Thanks
Piyali
Title | Under | Posted on |
---|---|---|
Component interface Error: no rows exist for the specified keys | PeopleSoft Technical | 03/15/2019 - 3:54am |
ADD 24 months starting from current month.(peoplesoft) | PeopleSoft Functional | 07/29/2018 - 8:44pm |
TRC values dropdown | PeopleSoft Technical | 04/04/2018 - 12:54am |
how to find missing sequence in GRID and print the mising sequence number while saving through peoplecode | PeopleSoft Technical | 09/11/2017 - 4:49am |
Hi Piyali,
It sounds like you need to use Do Select followed by a PeopleCode action to email the pdf for each employee (one employee at a time "Do Select").
The Do Select will enable you to process all rows returned, in your case, all employees who are getting transfered.
Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog
Hi..
thanks A lot for replying..
But in sendmail function we can just give a path of the file and only one fixed format can be sent.But i want to place the employee id .transfer date ,location in that pdf file..how to do that???
we genarally sendmail syntax we attach file like this.
&MAIL_FILES = "c:\temp\Transfer.pdf";.
I have to pass the my values in that" Transfer.pdf"
Like dear Amar ,
---------
You are gettiing tansfer to Australia.
--------------
how to put "Amar " and "Australia." in the attached file.??
I am waiting for your reply..
Thanks
Piyali.
Piyali,
You can pass your values inside your peoplecode action when writing to your file.
When you use the "Do Select" grab the name and country transfering to and store them in your STATE record. Then in your peoplecode action, open a new pdf file, something like this:
&path = "path_to_your_file_directory";
&PATHNAME = &path | &userFileName;
/** Open file for writing **/
/** PATHNAME is the both the path and the file name **/
&UserFile = GetFile(&PATHNAME, "W", %FilePath_Absolute);
Now, you need to write the email and pass the values from your stat record as such:
&UserFile.WriteLine("Like dear " | STATE_RECORD_AET.NAME | ",");
&UserFile.WriteLine(" ");
&UserFile.WriteLine("You are getting transferred to " | STATE_RECORD_AET.COUNTRY);
Then close the file and send the email out. The "Do Select" action will do this over and over for all users that are being transfered.
Hi..
Do Select is working fine.
I have written the code in the peoplecode action.
&LogFile = GetFile("c:\temp\HX_TRANSFER_log.txt", "w", "a", %FilePath_Absolute);
&userFileName = "Transfer" | ".pdf";
&path = "c:\temp\";
&PATHNAME = &path | &userFileName;
/** Open file for writing **/
/** PATHNAME is the both the path and the file name **/
&UserFile = GetFile(&PATHNAME, "W", %FilePath_Absolute);
/*** Writing email text ***/
&UserFile.WriteLine("Like dear " | HX_TRANSFER_AET.EMPLID | ",");
&UserFile.WriteLine(" ");
&UserFile.WriteLine("You are getting transferred to " | HX_TRANSFER_AET.TO_LOCATION);
&UserFile.close();
**************************************************
Its not writing the contents in the attachment.Pdf is getting generated but thats blank.
Kindly help.
--Piyali
You are saying the file is being created but no text in it?
Lets try this, check if the file is open before you write to it like so:
messagebox(0,"",0,0,("File is open!"));
&UserFile.WriteLine("Like dear " | HX_TRANSFER_AET.EMPLID | ",");&UserFile.WriteLine(" ");
&UserFile.WriteLine("You are getting transferred to " | HX_TRANSFER_AET.TO_LOCATION);
&UserFile.close();
Else
messagebox(0,"",0,0,("File NOT open!"));
End-if;
You can check your log file for the messagebox output. If this doesn't help then try writing to a .txt file instead of .pdf file and see what happens.
Good Luck!
Hi..
Thank u So much For your Help.I am able to create the file and can send as attachment after writing in it.
It is happening successfully in .doc and .txt file extension.but if i put .pdf i am getting the pdf as an attachment in mail ,but pdf is not opening.
It is giving this error
"Adobe reader could not open because either it is not a supported file type or the file has been damaged for example (it was sent as an email attachment and wasnt correctly decoded.)"
i have adobe reader 7 and pdf creater 0.8.
Kindly help.
Warm Regards,
P I Y A L I
Warm Regards,
P I Y A L I
I'm glad the .txt file is working. Creating a PDF file is not as straight forward as .txt. I personally never had to create one but I think Application Engine GP_SS_PSLP (HR Module) creates one by importing a package "import HCSC:PDF:UTIL:*;".
You might want to take a look at that one, I don't have the time to break it down to know how it is exactly doing that. It is just another thing for you to look at.
Please report back if you ever got the .pdf file to work, would love to hear how you've approached this. Good luck!
Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog
Hi..
First of all thanks for your appreciation and all your help.
I have done the same for confirmation process ,Transfer process and Separation process.previously we used to generate the letters for each and every employee manualy.Now it is going to the employee (As document .doc)with 16 dynamic fields that i have included in state record.
I have searched for that app engine GP_SS_PSLP .But didnt get.We are using peopletools 8.44 .
If you are having that just forward the same ,i will try to debug that and get the solution.
Thanks once again.
Warm Regards,
P I Y A L I
Warm Regards,
P I Y A L I
Hi,
I am able to trigger mail with excel attachment but in Excel sheet the values and the heading of the column are coming side-by-side...can anyone please help me to get the data in table format...