Monday, April 29, 2019

Peoplesoft: Add Manager into CC List in Generic Email Template


Open APP designer, EOAW_CORE Application Package, NotificationManager App Class

method Notify
   /+ &from_ as String, +/
   /+ &templateID_ as String, +/
   /+ &aryOpridTo_ as Array of String, +/
   /+ &pageURL_ as String, +/
   /+ &strSQLId_ as String, +/
   /+ &recThread_ as Record +/
   Local array of string &aryValues;
   Local array of PT_WF_NOTIFICATION:NotificationAddress &notifyTo;
   Local string &URL, &XMLVars;
   Local boolean &Status;
   Local PT_WF_NOTIFICATION:NotificationAddress &NotifyAddress;
   Local PT_WF_NOTIFICATION:NotificationTemplate &NotifyTemplate;
   Local PT_WF_NOTIFICATION:Notification &Notification;
   Local integer &i;
   Local string &opridTo, &emailTo, &oprDesc, &lng;
 
   Local array of string &langs = CreateArrayRept("", 0);
   Local number &langIndex;
   Local array of array of PT_WF_NOTIFICATION:NotificationAddress &langNotifyList = CreateArrayRept(CreateArrayRept(&NotifyAddress, 0), 0);
 
   /*Start: Custom Code To Populate CC Value*/
 
   Local array of PT_WF_NOTIFICATION:NotificationAddress &notifyCC;
   Local PT_WF_NOTIFICATION:NotificationAddress &FTNotifyAddressCC;
   Local string &opridCC, &emailCC, &oprDescCC, &lngCC, &SupID;
   Local array of string &langsCC = CreateArrayRept("", 0);
   Local number &langIndexCC;
   Local array of array of PT_WF_NOTIFICATION:NotificationAddress &FTlangNotifyListCC = CreateArrayRept(CreateArrayRept(&FTNotifyAddressCC, 0), 0);
   /*End: Custom Code To Populate CC Value*/
 
   &notifyTo = CreateArrayRept(&NotifyAddress, 0);
 
   For &i = 1 To &aryOpridTo_.Len
      &emailTo = %This.GetEmail(&aryOpridTo_ [&i]);
   
      If (All(&emailTo)) Then
         &oprDesc = %This.GetOprDescr(&aryOpridTo_ [&i], &lng);
         &NotifyAddress = create PT_WF_NOTIFICATION:NotificationAddress(&aryOpridTo_ [&i], &oprDesc, " ", &emailTo, "Email");
         rem Worklist Channel &NotifyAddress = create NotificationAddress(&aryOpridTo_ [&i], " ", " ", &emailTo, "Worklist");
         If (None(&lng)) Then
            &lng = %Language;
         End-If;
         &langIndex = &langs.Find(&lng);
         If (&langIndex > 0) Then
            &langNotifyList [&langIndex].Push(&NotifyAddress);
         Else
            &langs.Push(&lng);
            &notifyTo = CreateArrayRept(&NotifyAddress, 0);
            &notifyTo.Push(&NotifyAddress);
            &langNotifyList.Push(&notifyTo);
         End-If;
      End-If;
   
      /*Start: Custom Code To Populate CC Value*/
     
      &notifyCC = CreateArrayRept(&FTNotifyAddressCC, 0);
     
      For &i = 1 To &aryOpridTo_.Len
       
         rem SQLExec("SELECT OPRID FROM PSUSEREMAIL WHERE PRIMARY_EMAIL = 'Y' AND EMAILID = :1 ", &langNotifyList [&langIndex], &FTApproverOPRID);
         SQLExec("SELECT E.EMAILID,E.OPRID FROM PS_ROLEXLATOPR O,PSUSEREMAIL E WHERE O.ROLEUSER_SUPR=E.OPRID AND E.PRIMARY_EMAIL = 'Y' AND O.OPRID = :1", &aryOpridTo_ [&i], &emailCC, &SupID);
         rem &emailCC = %This.GetEmail(&aryOpridTo_ [&i]);
         If (All(&emailCC)) Then
            &oprDescCC = %This.GetOprDescr(&SupID, &lngCC);
            &FTNotifyAddressCC = create PT_WF_NOTIFICATION:NotificationAddress(&SupID, &oprDescCC, " ", &emailCC, "Email");
            If (None(&lngCC)) Then
               &lngCC = %Language;
            End-If;
            &langIndexCC = &langsCC.Find(&lngCC);
            If (&langIndexCC > 0) Then
               &FTlangNotifyListCC [&langIndexCC].Push(&FTNotifyAddressCC);
            Else
               &langsCC.Push(&lngCC);
               &notifyCC = CreateArrayRept(&FTNotifyAddressCC, 0);
               &notifyCC.Push(&FTNotifyAddressCC);
               &FTlangNotifyListCC.Push(&notifyCC);
            End-If;
         End-If;
       
      End-For;
     
      /*End: Custom Code To Populate CC Value*/
   
   
   
   End-For;
 
   Local number &templateIndex = &templateNames.Find(&templateID_);
   If (&templateIndex = 0) Then
      &NotifyTemplate = create PT_WF_NOTIFICATION:NotificationTemplate(" ", " ", &templateID_, "G");
      &templateNames.Push(&templateID_);
      &templates.Push(&NotifyTemplate);
   Else
      &NotifyTemplate = &templates [&templateIndex];
   End-If;
 
   For &langIndex = 1 To &langs.Len
      %This.currentLanguage = &langs [&langIndex];
      &aryValues = %This.LoadTemplateData(&pageURL_, &strSQLId_, &recThread_);
      &XMLVars = &NotifyTemplate.SetupGenericVars(&aryValues);
      &Status = &NotifyTemplate.GetAndExpandTemplate(%This.currentLanguage, &XMLVars);
      Local string &from = &from_;
      rem = %This.GetEmail(&from_);
      If (&Status) Then
         /* Send */
       
         &Notification = create PT_WF_NOTIFICATION:Notification(&from, %Date + %PerfTime, %Language);
         &Notification.NotifyTo = &langNotifyList [&langIndex];
       
         /*Start: Custom Code To Populate CC Value, You can use your own template name for escalations*/
         If &templateID_ = "Voucher Escalation" Then
           
            &Notification.NotifyCC = &FTlangNotifyListCC [&langIndex];
           
         End-If;
         /*End: Custom Code To Populate CC Value*/
         &Notification.Subject = &NotifyTemplate.Subject;
         &Notification.Message = &NotifyTemplate.Text;
         &Notification.Subject = Substitute(&Notification.Subject, "%NotificationPriority", &NotifyTemplate.Priority);
         &Notification.Message = Substitute(&Notification.Message, "%NotificationPriority", &NotifyTemplate.Priority);
         Evaluate &NotifyTemplate.SenderType
         When = "3" /* "Other" */
            &Notification.EmailReplyTo = &NotifyTemplate.SenderEmailID;
            Break;
         When = "2" /* System */
            &Notification.EmailReplyTo = %SMTPSender;
            Break;
            /* when = "1" is already assumed when the variable is set above */
         End-Evaluate;
       
         /* This property should be on each template to avoid sending all with one content-type */
         &Notification.ContentType = "Content-type: text/html; charset=UTF-8";
         &Notification.Send();
      Else
       
         Local EOAW_CORE:Utils &utils = GetUtilsSingleton();
         Local string &default = "Notification template (id " | &templateID_ | ") could not be expanded.";
         Local string &msg = MsgGetText(&utils.MSG_CATALOG, &utils.MSG_NOTIFICATION_FAILURE, &default, &templateID_);
         Local Exception &base = CreateException(&utils.MSG_CATALOG, &utils.MSG_NOTIFICATION_FAILURE, &default, &templateID_);
         throw create EOAW_CORE:EXCEPTIONS:SACError(&base, &msg);
      End-If;
   End-For;
end-method;

Monday, June 11, 2018

Migrate Generic Templates between databases

Generic Templates can be migrated from one database to another using Datamover export and import scripts. Which Template ID that are exported and imported can be controlled with WHERE clause.

1. Verify data to export, with SQL similar to this;
SELECT * FROM PS_WL_TEMPLATE_GEN WHERE WL_TEMPLATE_ID = 'custom template name';
SELECT * FROM PS_WL_TEMPL_GEN_TK WHERE WL_TEMPLATE_ID = 'custom template name';
SELECT * FROM PS_WL_TEMPL_GEN_RS WHERE WL_TEMPLATE_ID = 'custom template name';


2. Example Data Mover Export Script to export Generic Templates;
SET LOG C:\TEMP\GEN_TEMPLATE.LOG;
SET OUTPUT C:\TEMP\GEN_TEMPLATE.DAT;
EXPORT PS_WL_TEMPLATE_GEN WHERE WL_TEMPLATE_ID = 'custom template name';
EXPORT PS_WL_TEMPL_GEN_TK WHERE WL_TEMPLATE_ID = 'custom template name';
EXPORT PS_WL_TEMPL_GEN_RS WHERE WL_TEMPLATE_ID = 'custom template name';


3. Example Data Mover Import Script to import Generic Templates into another Database;

SET LOG C:\TEMP\DATAMOVE.LOG;
DELETE FROM PS_WL_TEMPLATE_GEN WHERE WL_TEMPLATE_ID = 'custom template name';
DELETE FROM PS_WL_TEMPL_GEN_TK WHERE WL_TEMPLATE_ID = 'custom template name';
DELETE FROM PS_WL_TEMPL_GEN_RS WHERE WL_TEMPLATE_ID = 'custom template name';

SET LOG C:\TEMP\IMP_TEMPLATE.LOG;
SET INPUT C:\TEMP\GEN_TEMPLATE.DAT;
SET NO SPACE;
SET NO RECORD;
SET NO INDEX;
IMPORT *;



4. Example of this running in a Demo system for Generic Template named 'THOMAS'.

EXPORT Script;
SET LOG D:\User\LThomas\3-1713987231\EXP_TEMPLATE.LOG;
SET OUTPUT D:\User\LThomas\3-1713987231\GEN_TEMPLATE.DAT;
EXPORT PS_WL_TEMPLATE_GEN WHERE WL_TEMPLATE_ID = 'THOMAS';
EXPORT PS_WL_TEMPL_GEN_TK WHERE WL_TEMPLATE_ID = 'THOMAS';
EXPORT PS_WL_TEMPL_GEN_RS WHERE WL_TEMPLATE_ID = 'THOMAS';

Started: Tue May 25 14:42:30 2010
Data Mover Release: 8.49.22
Database: Q900ZXYX (ENG)
Exporting WL_TEMPLATE_GEN
Export WL_TEMPLATE_GEN 1
Exporting WL_TEMPL_GEN_TK
Export WL_TEMPL_GEN_TK 1
Exporting WL_TEMPL_GEN_RS
Export WL_TEMPL_GEN_RS 0
Ended: Tue May 25 14:42:31 2010
Successful completion
Script Completed.


5. Example of this running in a Demo system for Generic Template named 'THOMAS'.

IMPORT Script;
SET LOG D:\User\LThomas\3-1713987231\DATAMOVE.LOG;
DELETE FROM PS_WL_TEMPLATE_GEN WHERE WL_TEMPLATE_ID = 'THOMAS';
DELETE FROM PS_WL_TEMPL_GEN_TK WHERE WL_TEMPLATE_ID = 'THOMAS';
DELETE FROM PS_WL_TEMPL_GEN_RS WHERE WL_TEMPLATE_ID = 'THOMAS';

SET LOG D:\User\LThomas\3-1713987231\IMP_TEMPLATE.LOG;
SET INPUT D:\User\LThomas\3-1713987231\GEN_TEMPLATE.DAT;
SET NO SPACE;
SET NO RECORD;
SET NO INDEX;
IMPORT *;

Started: Tue May 25 14:51:12 2010
Data Mover Release: 8.49.22
Database: Q900GXAE (ENG)
SQL Successful - DELETE FROM PS_WL_TEMPLATE_GEN WHERE WL_TEMPLATE_ID = 'THOMAS'
SQL Successful - DELETE FROM PS_WL_TEMPL_GEN_TK WHERE WL_TEMPLATE_ID = 'THOMAS'
SQL Successful - DELETE FROM PS_WL_TEMPL_GEN_RS WHERE WL_TEMPLATE_ID = 'THOMAS'
Ended: Tue May 25 14:51:12 2010
Successful completion
Started: Tue May 25 14:51:12 2010
Data Mover Release: 8.49.22
Database: Q900GXAE (ENG)
Input file: D:\User\LThomas\3-1713987231\GEN_TEMPLATE.DAT (ENG)
Commit done at end of record
Importing WL_TEMPLATE_GEN
Import WL_TEMPLATE_GEN 1
Records remaining: 2
Importing WL_TEMPL_GEN_TK
Import WL_TEMPL_GEN_TK 1
Records remaining: 1
Importing WL_TEMPL_GEN_RS
Import WL_TEMPL_GEN_RS 0
Ended: Tue May 25 14:51:13 2010
Successful completion
Script Completed.

Monday, April 30, 2018

Pages Used to Administer Content References

Page Name
Definition Name
Navigation
Usage
Content Ref Administration (content reference administration)
PORTAL_CREF_ADM
PeopleTools, Portal, Structure and Content, Portal Objects
Navigate to the Content References list and click Edit.. Or click Add Content Reference.
Add new content references or edit existing content references.
Content Reference Security
PORTAL_CREF_SEC
PeopleTools, Portal, Structure and Content, Portal Objects, Content Ref Administration, Security
Set content reference security.
User ID Queries
USER_QUERY
PeopleTools, Security, User Profiles, User Profiles, User ID Queries
Review content reference security by user.
Permission List Queries
PLIST_QUERIES
PeopleTools, Security, Permissions & Roles, Permission Lists, Permission List Queries
Review content reference security by permission list.
Role Queries
ROLE_QUERY
PeopleTools, Security, Permissions & Roles, Roles, Role Queries
Review content reference security by role.
Select a Content Reference or Content Reference Link
PORTAL_CREF_SELECT
PeopleTools, Portal, Structure and Content, Portal Objects
Navigate to the Content References list and click Add Content Reference Link.
Select a content reference or content reference link.
Content Reference Link Administration
PORTAL_CREF_LNK
  • Click a content reference link on the Content Reference or Content Reference Link page.
  • PeopleTools, Portal, Structure and Content, Portal Objects
    Navigate to the Content References list and click Create Link.
  • PeopleTools, Portal, Structure and Content, Portal Objects
    Navigate to the Content References list and click Edit for any content reference of usage type Target.
    Click Create Content Reference Link.
Add new or edit existing content reference links.
Related Links Group
PORTAL_RLNK_ADM
  • PeopleTools, Portal, Structure and Content, Portal Objects
    Navigate to the Content References list and click the Edit link.
  • Select the template name RELATEDLINKS_TEMPLATE.
    Enter RELLINK in the Name field of the Content Reference Attributes section.
    Enter a label for the attribute.
    Click the Edit Related Links link.
Create related links groups.
Security
PORTAL_CLINK_SEC
PeopleTools, Portal, Structure and Content, Portal Objects, Content Reference Link Administration, Security
Set content reference link security.

Thursday, April 26, 2018

Site Name Is Not Valid When Clicking Search Results

Tools VersionOn : 8.55 version, Elastic Search 

When searching with Elasticsearch in a test 9.2 we receive results but when clicking the result we are receiving the error ""Site name is not valid. check your syntax and try again." when clicking a result on the search results page. 

WorkAround:


Navigate to Integration Broker Nodes and sort by local. Check the Portal and Content URLs of each node marked local to verify the site name is in lower case for both.

Here are the steps to make it work after a change to the Portal or content URL's:
Make certain this change is made to ALL LOCAL NODES. For example, for HCM, this would need to be defined for PSFT_HR and HRMS nodes.

After you make the above changes, you will need to rebuild the search indices. Do this as follows:

A. Undeploy/Redeploy any Search Definitions that were built with incorrect URL's as follows:
  • Navigate to PeopleTools, Search Framework, Administration, Deploy/Delete Object
  • Check box next to the non-working Search Definition
  • Click 'Undeploy'
  • After it completes, check the box next to Search Definition and this time click 'Deploy'
B. Rebuild Search Index
  • Navigate to PeopleTools, Search Framework, Administration, Schedule Search Index
  • Bring up the Run Control needed to run a Full Index build and launch it.
C. After the "Build Search Index" process has completed, re-test and verify that issue is resolved.

This should fix the issue as the links were indexed with the prior entries.

Monday, April 23, 2018

How to disable "Personalize Page" link for all users? And Give Access to Adminstrator?

To disable "Personalize Page" link globally, please use the following steps 1. Navigate to Peopletools > Personalization > Personalization Options 2. Select "PPTL" for People Tools 3. Locate CUSTOMPGSET - Customize Page Settings 4. Set Option Default Value to N 5. Save If you would like to have administrate to override the global option, use the following steps 1. Navigate to Peopletools > Security > Permissions and Roles > Permission List 2. Open the permission list that only shared among the Adminstrator 3. At the Personalization tab, add a new row 4. Choose "PPTL" for Option Category Level, and "PS Internet Architecture" for Option Category Group 5. Click Edit link and select "Allow User Option" for Customize Page Settings row. 6. Click OK and Save 7. Go to Main Manu and select My Personalization 8. Click "Personalize General Options" 9. Set the Override value for "Customize Page Settings " and Click OK

How To Restrict Users From Adding Homepages or Tiles in Fluid Homepages

The Add To functionality (all of it not just parts) are determined by 3 things: 1. Does the component itself have the Add To functionality enabled in Component Properties (default is enabled): - Open component definition in App Designer - Access the component's Component Properties. - Click the "Fluid" tab - Check "Add To" option box to see if it's checked 2. Does the user have permission to access the iScript which performs the Add To functionality? Development stated the following code is checked specifically: --IsIScriptAuthorized("WEBLIB_PTNUI", "PT_BUTTON_PIN", "FieldFormula", "IScript_SavePin", %Action_UpdateDisplay); So one can check: - PeopleTools > Security > Permissions & Roles > Permission Lists - Open the user's individual permission lists - Go to the "Web Libraries" tab - See if there is permission given to: Web Library: WEBLIB_PTNUI Function: PT_BUTTON_PIN.FieldFormula.IScript_SavePin 3. The form factor of the device being used to access the application. The Add To functionality is disabled on the small form factor. So users accessing the application from a small form factor device (such as smartphones) will not see the Add To feature. The above will determine access to all 3 of "Add To Homepage", "Add To Favorites" and "Add To Navbar". There are no options at a more granular level to control each individual "Add To" item.

How to Hide Global Search Icon and Add To items in Fluid Navigation Header

On the Fluid landing page, the Global Search icon and the 'Add to' items on the Actions list can be hidden by removing security access to components PTSF_GBLSRCH_FLUID and PTSF_GLOBAL_SEARCH under menu PORTAL_ADMIN in permission list PTPT1000. On the Learning Home Dashboard page, it is more involved, since the Fluid landing page is a physical component whereas Classic Learner Home is a Content reference link. - To hide the Global Search icon - Going to PeopleTools > Portal > General Settings, then turning off "Display global search in header" removes the global search icon from the header. - To hide the 'Add to...' items from the Actions list - To remove access for users to the 'Add To...' items, you need to remove security access to point #2 in Doc ID 1983068.1 (see Related Knowledge). In other words, remove access to the iScript WEBLIB_PTNUI.PT_BUTTON_PIN.FieldFormula.IScript_SavePin Note: This hides all of the 'Add to...' items from the Actions list; there is currently no way to selectively choose which 'Add to...' items you hide/unhide, it is all or nothing. Source : Doc ID 2198358.1