PeopleSoft Help: Function IsLeapYear
Function IsLeapYear(&iYear As ...: Function IsLeapYear Function IsLeapYear(&iYear As number) If (&iYear Mod 4 = 0) And ((&iYear Mod 100 <> 0) Or (&iYear Mod 400 = 0)) Then ...
Monday, March 26, 2012
PRINT BUTTON PeopleCode
<HTML<FORM>
<INPUT TYPE="SUBMIT" NAME="Print Button" value="Print Button"
style="background-color:#FFFF00;"
title="PRINT" onclik=' ' onMouseOver="this.style.background ='#00FF00'"
onMouseOut="this.style.background='#FFFF00'"onClick="window.print()">
</FORM>
</HTML>
<div id="buttons">
<input type="button" class="search-btn" value=" Print "
onclick="javascript:window.print()" />
<input type="button" value=" Close" onclick="javascript:window.close()" />
</div>
HTML code fro Print Button
(Button Color, On mouse Color change for PeopleSoft Pages ).
<html>
<form action="">
<input type="button" value="Hello world!" style="background-color:#FFFF00;"
title="PRINT" onclik=' ' onMouseOver="this.style.background ='#00FF00'"
onMouseOut="this.style.background='#FFFF00'" onClick="window.print()">
</form>
</body>
</html>
MakeDateFromString
Function MakeDateFromString(&sDate) Returns date
Local date &dtRetDt, &dtNull;
Local number &nMonth, &nDay, &nYear;
If All(&sDate) And
&sDate <> "00000000" Then
&nMonth = Value(Substring(&sDate, 5, 2));
&nDay = Value(Substring(&sDate, 7, 2));
&nYear = Value(Substring(&sDate, 1, 4));
rem &fileBatch.WriteLine("&nMonth: " | &nMonth | "&nDay: " | &nDay | "&nYear: " | &nYear);
Return Date3(&nYear, &nMonth, &nDay);
Else
Return &dtNull;
End-If;
End-Function;
DeleteFile Function
Local string &sReturnValue;
Local File &RQST_FILE1 = GetFile(&FilePath | &sFileName, "W", %FilePath_Absolute);
Local number &retcode;
Local JavaObject &oDelFile;
&FNAMES = FindFiles(&FilePath | &sFileName, %FilePath_Absolute);
If &FNAMES.Len > 0 Then
MessageBox(0, "", 0, 0, "fileExists " | &FNAMES [1]);
If All(&RQST_FILE1) Then
&oDelFile = CreateJavaObject("java.io.File", &FilePath | &sFileName);
&sFileName1 = &oDelFile.getName();
&nFilelength1 = &oDelFile.length();
MessageBox(0, "", 0, 0, "&sFileName1 " | &sFileName1);
MessageBox(0, "", 0, 0, "&nFilelength1 " | &nFilelength1);
&oDelFile.delete();
Return "DELETED";
End-If;
End-If;
Return " ";
End-Function;
PeopleSoft Help: Send Mail WithAttachmentsFunction SendMCFMailWith...
PeopleSoft Help: Send Mail WithAttachments
Function SendMCFMailWith...: Send Mail WithAttachments Function SendMCFMailWithAttach(&sFrom As string, &sSubject As string, &sEmail_BODY As string, &sMAIL_FILES As str...
Function SendMCFMailWith...: Send Mail WithAttachments Function SendMCFMailWithAttach(&sFrom As string, &sSubject As string, &sEmail_BODY As string, &sMAIL_FILES As str...
Send Mail WithAttachments
Function SendMCFMailWithAttach(&sFrom As string, &sSubject As string, &sEmail_BODY As string, &sMAIL_FILES As string, &sFileName As string) Returns number
Local PT_MCF_MAIL:MCFMultipart &multipartobj = create PT_MCF_MAIL:MCFMultipart();
Local PT_MCF_MAIL:MCFOutboundEmail &sendmailobj = create PT_MCF_MAIL:MCFOutboundEmail();
Local PT_MCF_MAIL:MCFBodyPart &htmlpart = create PT_MCF_MAIL:MCFBodyPart();
Local integer &sendstatus;
SQLExec("SELECT EMAILID FROM PSUSEREMAIL a where OPRID=:1 and EMAILTYPE='BUS' and PRIMARY_EMAIL='Y'", %UserId, &sEMAILID);
If All(&sEMAILID) Then
Else
&Email_Ids = &sEMAILID; /*Default Emaild*/
End-If;
If All(&sFrom) Then
&sendmailobj.From = &sFrom;
End-If;
&sendmailobj.Subject = &sSubject;
&sendmailobj.Recipients = &sEMAILID;
&htmlpart.Text = &sEmail_BODY;
&htmlpart.ContentType = "text/html";
If All(&sMAIL_FILES) Then
&htmlpart.AttachmentURL = &sMAIL_FILES;
&htmlpart.FileName = &sFileName;
&htmlpart.FilePathType = %FilePath_Absolute;
End-If;
&multipartobj.AddBodyPart(&htmlpart);
&sendmailobj.MultiPart = &multipartobj;
&sendmailobj.ContentType = "text/html";
If All(&sEMAILID) Then
&sendstatus = &sendmailobj.Send();
Else
MessageBox(0, "", 0, 0, "*** NO USER NOTIFICATION SETUP ***");
End-If;
Return &sendstatus;
End-Function;
Send Email From ProcessScheduler Processes
Function SendEmailFromProcessScheduler(&ProcessType As string, &ProcessName As string, &sEmailSubject As string, &sEmailBody As string)
Local SQL &Email_ID_SQL;
Local string &EmaiId, &Email_Ids;
&Email_Ids = "";
&Email_ID_SQL = CreateSQL("SELECT A.EMAILID FROM PSUSEREMAIL A, PS_PRCSDEFNNOTIFY B WHERE A.OPRID = B.DISTID AND B.PRCSTYPE =:1 AND B.PRCSNAME = :2 AND B.DISTIDTYPE = '2' AND A.EMAILTYPE = 'BUS' union SELECT A.EMAILID FROM PSUSEREMAIL A, PS_PRCSDEFNNOTIFY B, PS_ROLEUSER_VW C WHERE A.OPRID = C.ROLEUSER AND C.ROLENAME = B.DISTID AND B.PRCSTYPE =:1 AND B.PRCSNAME = :2 AND B.DISTIDTYPE = '3' AND A.EMAILTYPE = 'BUS' ", (&ProcessType, &ProcessName);
While &Email_ID_SQL.Fetch(&EmaiId)
If &Email_Ids = "" Then
&Email_Ids = &EmaiId
Else
&Email_Ids = &Email_Ids | ";" | &EmaiId
End-If
End-While;
&Email_ID_SQL.Close();
&nFlag = 0;
&strCC = "";
&strBCC = "";
If All(&Email_Ids) Then
SendMail(&nFlag, &Email_Ids, &strCC, &strBCC, &sEmailSubject, &sEmailBody);
Else
MessageBox(0, "", 0, 0, "*** NO USER NOTIFICATION SETUP ***");
End-If;
End-Function;
Subscribe to:
Posts (Atom)