Saturday, 15 October 2016

Disabling copy paste on an input field

We have Email address and Confirm Email Address fields on the page  and we want that  
the user should not be permitted to copy and paste from the first field to the second, they should retype their email address.

1) Place the two input fields on the page and connect them to the records you wish to save to, as usual.

2) Place an HTML Area on the page, making sure it should be placed after / beneath all the fields available on the page   



3) Make the HTML Area contents static, and paste in the following: 

 Record.fieldname  =  IOBM_A_BIO_INFO.IOBM_A_CNFRM_EMAIL   in javascript  dot will replace with underscore .


 <SCRIPT language=JavaScript>
var message = "Paste disabled. Please re-key.";

function disablepaste(){


return false;
}

document.getElementById('IOBM_A_BIO_INFO_IOBM_A_CNFRM_EMAIL').onpaste=disablepaste;
</SCRIPT>


 

Monday, 11 January 2016

Setting up PeopleSoft for Single Sign-On with Oracle Access Manager

1. Create a user profile  OAMPSFT  with id type None  and assign PeopleSoft user role in roles tab.








2.  Configure PeopleSoft to allow public access.

Go to the configuration.properties file.I have the following path

/u01/psconfig/PT8.52/webserv/peoplesoft/applications/peoplesoft/PORTAL.war/WEB-INF/psftdocs/ps/configuration.properties

2.1  Check the web profile value  , in my case 


WebProfile = PROD


2.2  Go to this Navigation

Main Menu  > PeopleTools  > Web Profiles > Web Profile Configuration

Search the WebProfile = PROD as the public access user ID.







3. From the PeopleTools Application Designer, open the FUNCLIB_LDAP record.   Right-click the LDAPAUTH field and select View People Code. Find the getWWWAuthConfig() function and replace the value that is assigned to the &defaultUserId with OAMPSFT.save the record.






3.2 replace the highlighted code 

Function getWWWAuthConfig()

   &defaultUserId = "OAMPSFT";


End-Function;

-----------------------------------------------

Function OAMSSO_AUTHENTICATION()
   If %PSAuthResult = True And
         &authMethod <> "LDAP" And
         &authMethod <> "WWW" And
         &authMethod <> "OSSO" And
         &authMethod <> "SSO" Then
      getWWWAuthConfig();
      If %SignonUserId = &defaultUserId Then

         &userID = %Request.GetHeader("PS_SSO_UID");

         If &userID <> "" Then
            If &bConfigRead = False Then
               getLDAPConfig();
            End-If;

            SetAuthenticationResult( True, &userID, "", False);

            &authMethod = "OAMSSO";
         End-If;
      End-If;
   End-If;
End-Function;


4. Access the SignonPeopleCode page
PeopleTools > Security > Security Objects >SignonPeopleCode
Only  enable the OAMSSO_AUTHENTICATION function in the SignonPeopleCode for Oracle Access Manager single signon. and save the page.








5. Configuring Single Signoff

 5.1   Write this code in a notepad file and save it as signout.html

  Place the singout.html file to this directory 

PS_HOME\webserv\YOUR_DOMAIN\applications\peoplesoft\PORTAL\WEB-INF\psftdocs\YOUR_SITE\signout.html
   
   
    <HTML>
    <HEAD>
    <title>  Logout    </title>
<meta HTTP-EQUIV='Refresh' CONTENT='1; URL=http://ssooam.up.edu.ph:14100/oam/server/logout'>
</HEAD>
</HTML>

On clicking the singout link , my page will redirect to this URL http://ssooam.up.edu.ph:14100/oam/server/logout

5.2   For this redirect to work, we need to change your Web Profile Configuration > Look and Feel (Tab)

5.2.1  Set Signon Result Doc Page to signonresultdocredirect.html
5.2.2  In the Signon/Logout Pages group box, change the value of the Logout Page field to signout.html.



Restart the app server and web server .


Wednesday, 9 December 2015

Populating Array in Poeplecode

There are several ways to populate an array. The example code following each of these methods creates the exact same array, with the same elements:

---------------------------------------------------------------------
Use CreateArray when you initially create the array:

Local Array of Number &MyArray;
&MyArray = CreateArray(100, 200, 300);


----------------------------------------------------------------------

Using CreateArray without any parameters creates an array of Any.

Local Array of Any &MYARRAY;

 &MYARRAY = CreateArray();
 &MYARRAY[1] = 100;
 &MYARRAY[2] = 200;
 &MYARRAY[3] = 300;

------------------------------------------------------------------------


Use the Push method to add items to the end of the array:
Local Array of Number &MYARRAY;
 Local Number &MYNUM;

 &MYARRAY = CreateArrayRept(&MYNUM, 0);
 /* this creates an empty array of number */
 &MYARRAY.Push(100);
 &MYARRAY.Push(200);
 &MYARRAY.Push(300);


-------------------------------------------------------------------------

Use the Unshift method to add items to the beginning of the array:
 Local Array of Number &MYARRAY;
 Local Number &MYNUM;

 &MYARRAY = CreateArrayRept(&MYNUM, 0);
 /* this creates an empty array of number */
 &MYARRAY.Unshift(300);
 &MYARRAY.Unshift(200);
 &MYARRAY.Unshift(100);

-------------------------------------------------------------------------

Friday, 16 October 2015

Highlight empty fields in RED for error messages


Question Rating Field  is present in a grid  and on page save button , I am verifying that it should not be empty . I have a custom save button and I have written this code on save button field change event.


Local Rowset &level1;

&level1 = GetLevel0().GetRow(1).GetRowset(Scroll.L_INST_EVAL_TBL);
For &i = 1 To &level1.ActiveRowCount
  
  
   If None(&level1.GetRow(&i).L_INST_EVAL_TBL.L_QUESTION_RATING.Value) Then
      SetCursorPos(%Page, L_INST_EVAL_TBL.L_QUESTION_RATING, CurrentRowNumber());
     
     
     
      &level1.GetRow(&i).L_INST_EVAL_TBL.L_QUESTION_RATING.Style = "PSERROR";
      Error MsgGet(31000, 23, "Please Select  A Rating value");
     
   Else
      &level1.GetRow(&i).L_INST_EVAL_TBL.L_QUESTION_RATING.Style = "PSEDITBOX";
   End-If;
  
  
End-For;

Thursday, 25 June 2015

Export Users / Roles / Permission lists and Setup SACR Secuirty


set output C:\configurations_AS.dat;

--- academic institution
EXPORT PS_SCRTY_TBL_INST;

--- institution/Career Security Export
EXPORT PS_SCRTY_TBL_CAR;

--- academic Program Security Export
EXPORT PS_SCRTY_TBL_PROG;

--- academic Plan Security Export
EXPORT PS_SCRTY_TBL_PLAN;

--- academic Org Security Export
EXPORT PS_SCRTY_TBL_ACAD;

--- Admissions Action Security Export
EXPORT PS_SCRTY_ADM_ACTN;

--- Program Action Security Export
EXPORT PS_SCRTY_PROG_ACTN;

--- Application Center Security Export
EXPORT PS_SCRTY_APPL_CTR;

--- Recruiting Center Security Export
EXPORT PS_SCRTY_RECR_CTR;


--- Enrollment Security Export (Override Table)
EXPORT PS_ENRMT_OVRD_TBL;

--- Enrollment Security Export
EXPORT PS_OPR_DEF_TBL_CS;

--- Service Indicator Security Export
EXPORT PS_SCRTY_TBL_SRVC;

--- Student Group Security Export
EXPORT PS_SCRTY_TBL_STGP;

--- Transcript Type Security Export
EXPORT PS_SCRTY_TSCRPT;

--- New Transcript Type Security Export
EXPORT PS_SSR_SCRTY_TSRPT;

--- Test ID Security Export
EXPORT PS_SAD_TEST_SCTY;

--- Population Update Security Export
EXPORT PS_SCCPU_SRTY_TBL;

--- PERMISSION LISTS
EXPORT PSCLASSDEFN;
EXPORT PSAUTHBUSCOMP;
EXPORT PSAUTHCHNLMON;
EXPORT PSAUTHCUBE;
EXPORT PSAUTHITEM;
EXPORT PSAUTHOPTN;
EXPORT PSAUTHPRCS;
EXPORT PSAUTHSIGNON;
EXPORT PSPRCSPRFL;
EXPORT PS_MC_OPR_SECURITY;
EXPORT PS_MC_OPRID;
EXPORT PS_SCRTY_ACC_GRP;
EXPORT PS_SCRTY_QUERY;




--- ROLES
EXPORT PSROLEDEFN;
EXPORT PSROLEDEFNLANG;
EXPORT PSROLECANGRANT;
EXPORT PSROLECLASS;

--- USERS
EXPORT PSOPRDEFN;
EXPORT PSOPRALIAS;
EXPORT PSROLEUSER;
EXPORT PSUSERATTR;
EXPORT PSUSEREMAIL;
EXPORT PSUSERPRSNLOPTN;
EXPORT PS_ROLEXLATOPR;
EXPORT PS_RTE_CNTL_RUSER;

--- ACCESS PROFILES
EXPORT PSACCESSPRFL;

--- DEFINITION Security
EXPORT PSOBJGROUP;
EXPORT PSOPROBJ;

--- PERSONALIZATIONS
EXPORT PSUSEROPTNDEFN;
EXPORT PSUSEROPTNLANG;
EXPORT PSOPTNCATGRPLNG;
EXPORT PSOPTNCATGRPTBL;
EXPORT PSOPTNCATTBL;
EXPORT PSOPTNCATLANG;

--- Security OPTIONS
EXPORT PSSECOPTIONS;




---------------------------------- Academic Structure and other configurations -----------------------

--- "Student Group Table"

EXPORT STDNT_GROUP_TBL;
EXPORT STDNT_GROUP_LNG;

--- "Service Indicator Table"

EXPORT SERVICE_IMPACT;
EXPORT SERVICE_IMP_LNG;
EXPORT SRVC_IND_CD_TBL;
EXPORT SRVC_IND_CD_LNG;
EXPORT SRVC_IN_RSN_TBL;
EXPORT SRVC_IN_RSN_LNG;

--- "Service Impact Table"

EXPORT SRVC_IMPACT_TBL;

--- "Enrollment Action Reason"

EXPORT ENRL_RSN_TBL;
EXPORT ENRL_RSN_LANG;

---Departments Table

Export PS_DEPT_TBL;

---Dept Security

EXPORT PS_SCRTY_TBL_DEPT;
EXPORT PS_SJT_DEPT;

---Academic program
EXPORT ACAD_PROG_LANG;
EXPORT ACAD_PROG_TBL;
EXPORT HOME_CAMPUS_TBL;
EXPORT SAD_PB_PROG;

---Academic Plan Table
EXPORT ACAD_PLAN_OWNER;
EXPORT ACAD_PLAN_TBL;
EXPORT ACAD_PLAN_LANG;

---Degree Table
EXPORT DEGREE_TBL;
EXPORT DEGREE_TBL_LANG;

---PROG ACTION
EXPORT PROG_ACTION_LNG;
EXPORT PROG_ACTION_TBL;



---Academic SubPlan Table
EXPORT ACAD_SUBPLN_TBL;
EXPORT ACAD_SUBPLN_LNG;
EXPORT SSR_SUBPLAN_AUS;

---Academic Subject Table
EXPORT SSR_SUBJECT_AUS;
EXPORT SUBJECT_TBL;
EXPORT SUBJECT_TBL_LNG;
EXPORT SUBJ_COMPONENT;
EXPORT SUBJ_OWNER_TBL;

---PROG REASON
EXPORT PROG_RSN_LNG;
EXPORT PROG_RSN_TBL;



---Campus Table
EXPORT CAMPUS_LOC_TBL;
EXPORT CAMPUS_TBL;
EXPORT CAMPUS_LANG;

---Grading Scheme Table
EXPORT GRADESCHEME_TBL;
EXPORT GRADESCHEME_LNG;
EXPORT GRADE_BASIS_TBL;
EXPORT GRADE_BASIS_LNG;
EXPORT GRADE_TBL;
EXPORT GRADE_TBL_LANG;
EXPORT GRD_BASE_CHOICE;

---Grading Basis Exception Rule
EXPORT GB_EXC_MAP;
EXPORT GB_EXC_MAP_LNG;
EXPORT GB_EXC_MAP_DTL;


---Milestone Table
EXPORT MILESTONE_TBL;
EXPORT MILESTONE_LANG;
EXPORT MLSTN_LVL_TBL;
EXPORT MLSTN_LVL_LANG;
EXPORT SSR_MILESTN_NZL;

---Application Center Table
EXPORT ADM_APPLCTR_TBL;
EXPORT ADM_APPLCTR_LNG;

---Program Action Reason Table
EXPORT PROG_RSN_TBL;
EXPORT PROG_RSN_LNG;

---Define Career Types
EXPORT ACAD_CAR_TBL;
EXPORT ACAD_CAR_LANG;
EXPORT ACAD_CAR_PTRS;
EXPORT SSR_ACD_CAR_NZL;

---Installation table
EXPORT PS_INSTALLATION;

---Admit Type Table
EXPORT   ADMIT_TYPE_TBL;
EXPORT   ADMIT_TYPE_LNG;

---External GPA Type Table
EXPORT   GPA_TYPE_TBL;
EXPORT   GPA_TYPE_LANG;
EXPORT   GPA_VALUE_TBL;
EXPORT   GPA_VALUE_LANG;

---Academic Group Table
EXPORT   ACAD_GROUP_TBL;
EXPORT   ACAD_GROUP_LANG;
EXPORT   CATLG_CAR_TBL;
EXPORT  STND_MTGPAT_TBL;

---Translate values
EXPORT PSXLATDEFN;
EXPORT PSXLATDEFNDEL;
EXPORT PSXLATITEM;
EXPORT PSXLATITEMLANG;


---External Summary Type Table
EXPORT   EXT_SUMM_TP_TBL;

---Admissions Action Table
EXPORT   ADM_ACTION_TBL;
EXPORT   ADM_ACTION_LANG;

---Level/Load Rules Table
EXPORT ACAD_LEVEL_TBL;
EXPORT ACAD_LOAD2_TBL;
EXPORT ACAD_LOAD_TBL;
EXPORT LVL_LD_RULE_TBL;
EXPORT LVL_LD_RULE_LNG;
EXPORT SSR_LVLLOAD_AUS;


---Unit Conversion Table
EXPORT TERM_TYPE_TBL;
EXPORT UNIT_CONVR_TBL;

---Career Pointer Exception Rule
EXPORT CAR_PTR_EXC;
EXPORT CAR_PTR_EXC_LNG;
EXPORT CAR_PTR_EXC_DTL;

---Complete Grade Flag
EXPORT SSR_GRADE_FLAG;
EXPORT SSR_GRD_FLAG_LN;

---Grade Category
EXPORT GRADE_CAT_DTL;
EXPORT GRD_CAT_DTL_LNG;
EXPORT GRADE_CAT_TBL;

---Academic Standing Table
EXPORT ACAD_STACTN_TBL;
EXPORT ACAD_STACTN_LNG;
EXPORT ACAD_STDNG_TBL;

---Academic Standing Rule
EXPORT ACAD_STDNG_RULE;
EXPORT ACAD_STDNG_LANG;
EXPORT ACAD_ST_RUL_DTL;

---Honors/Awards Rule
EXPORT HNR_AWD_RUL_DTL;
EXPORT HONOR_AWRD_RULE;
EXPORT HONOR_AWRD_LANG;

---Academic Organization Table
EXPORT ACAD_ORG_FS_OWN;
EXPORT ACAD_ORG_HR_OWN;
EXPORT ACAD_ORG_TBL;
EXPORT ACAD_ORG_LANG;
EXPORT SSR_ACD_ORG_AUS;

---Honors and Awards Table
EXPORT HONOR_AWARD_TBL;
EXPORT HONOR_AWARD_LNG;


---Checklist Table
EXPORT CS_CHKLST_ITEM;
EXPORT CS_CHKLST_TBL;
EXPORT CS_CHKLST_LANG;

---Test Component Table
EXPORT SA_TEST_CMP_TBL;
EXPORT SA_TEST_CMP_LNG;

---Test Tables
EXPORT SA_TCMP_REL_TBL;
EXPORT SA_TCMP_REL_LNG;
EXPORT SA_TEST_TBL;
EXPORT SA_TEST_LANG;

---External Test Score Mapping
EXPORT SAD_TEST_RECS;
EXPORT SAD_TEST_RECS2;
EXPORT SAD_TEST_SETUP;
EXPORT SAD_TEST_SETUP2;

---Checklist Item Table
EXPORT SCC_CKLSITM_TBL;
EXPORT SCC_CKLSITM_LNG;

---Checklist Item Functions Table
EXPORT CHK_FUNCTN_TBL;

---Event Type Table
EXPORT EVENT_TYPE_TBL;
EXPORT EVENT_TYPE_LANG;

---3C Update/Inquiry Group Table
EXPORT GRP_3C_TBL;
EXPORT GRP_3C_LANG;

---Checklist 3C Groups
EXPORT CS_CHKLST_3CGRP;

---Event Definition
EXPORT EVNT_3CS_TBL;
EXPORT EVNT_3CS_LANG;
EXPORT EVNT_CHKITM_TBL;
EXPORT EVNT_CHKLST_TBL;
EXPORT EVNT_CMNT_TBL;
EXPORT EVNT_COMM_TBL;


---SF Business Unit
EXPORT BUS_UNIT_TBL_SF;
EXPORT BUS_UNIT_LNG;
EXPORT BU_SF_RCPT_NO;








Tuesday, 9 December 2014

How to Skip / Bypass a PeopleSoft search record

There are some situations for example Self Service Pages where we want the user to directly land on the require page by skipping the search page information .

We can bypass the component search page in two  different ways.

1. Set Installation table as component search record

 Any record with no search keys is being set as component search record is called Installation table .

2.  we can write the following peoplecode on SearchInit event of  component level search record


     SetSearchDialogBehavior(0);

For Example , If the page extracts information of the user by taking emplid , we can write the following peoplecode on above mentioned event 

     Search_Record.EMPLID = %EmployeeId ;
     SetSearchDialogBehavior(0);
 



 

Thursday, 27 November 2014

Send SMS Using Peoplecode


Local String &MobileNumbr = "03434605956" ;

Local String &rand1 , &MSG_ID , &reqStr ;

/* Random Msg ID generation */

   &rand1 = Int(Rand() * 10);
   &rand2 = Int(Rand() * 10);
   &rand3 = Int(Rand() * 10);
   &rand4 = Int(Rand() * 10);
   &rand5 = Int(Rand() * 10);
   &rand6 = Int(Rand() * 10);
   &rand7 = Int(Rand() * 25) + 65;
   &rand8 = Int(Rand() * 25) + 65;
  
   &MSG_ID = &rand1 | &rand2 | &rand3 | &rand7 | &rand4 | &rand5 | &rand6 | &rand8;

   &reqStr = "<?xml version=""1.0"" encoding=""utf-8""?>  <soapenv:Envelope xmlns:soapenv=";
   &reqStr = &reqStr | """http://schemas.xmlsoap.org/soap/envelope/""";
   &reqStr = &reqStr | " xmlns:urn=" | """urn:webService""";
   &reqStr = &reqStr | "> <soapenv:Header>  <wsse:Security soapenv:mustUnderstand=""1"" ";
   &reqStr = &reqStr | "xmlns:wsse=";

   &reqStr = &reqStr | """http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-   secext-1.0.xsd""";

   &reqStr = &reqStr | ">   <wsse:UsernameToken> <wsse:Username>PS</wsse:Username> <wsse:Password Type=";

   &reqStr = &reqStr | """http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText""";

   &reqStr = &reqStr | ">PS</wsse:Password> </wsse:UsernameToken> </wsse:Security> </soapenv:Header> <soapenv:Body><urn:sendSMS><arrayData>  <!--You may enter the following 6 items in any order-->  <mobile>";

   &reqStr = &reqStr | &MOBILE;
   &reqStr = &reqStr | "</mobile> <password>password1234</password> <sender>";
   &reqStr = &reqStr | &SENDER;
   &reqStr = &reqStr | "</sender> <numbers>";
   &reqStr = &reqStr | &MOBILE_PHONE;
   &reqStr = &reqStr | "</numbers> <msg>";
   &reqStr = &reqStr | &BODY;
   &reqStr = &reqStr | "</msg> <msgId>";
   &reqStr = &reqStr | &MSG_ID;
   &reqStr = &reqStr | "</msgId></arrayData> </urn:sendSMS>   </soapenv:Body>
</soapenv:Envelope>";

 &length = Len(&BODY);
  
   If &length <= 156 Then
     
     
      /* (1) Create Request Message from Service Operation */
      &reqMsg = CreateMessage(Operation.SENDSMS10005, %IntBroker_Request);

      /* (2) Create XML Document from Request XML Text String */
      &inXml = CreateXmlDoc(&reqStr);

      /* (3) Set XML Document on Request Message */
      &reqMsg.SetXmlDoc(&inXml);

      /* (4) Invoke SyncRequest for Request Message */
      &respMsg = %IntBroker.SyncRequest(&reqMsg);

      /* (5) Get XML Document from Response Message */
      &outXml = &respMsg.GetXmlDoc();
     
      &userProfile = &outXml.DocumentElement;
      Local number &SMSReturn = &userProfile.GetElementsByTagName("return")[1].NodeValue;


Else
      &toLong = "Message body is too long.";
      MessageBox(0, "", 0, 0, "Message Not Sent." | &toLong);
   End-If;
  
  
  
   If  &SMSReturn = 1 Then
      MessageBox(0, "", 0, 0, "Message Sent.");
     
   Else
      If &SMSReturn <> 1 Then
         &Return = "2";
         MessageBox(0, "", 0, 0, "Message Sending Failed. And Return Code Is = " | &SMSReturn);
      End-If;
   End-If;