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 ¬ifyTo;
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 ¬ifyCC;
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*/
¬ifyTo = 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);
¬ifyTo = CreateArrayRept(&NotifyAddress, 0);
¬ifyTo.Push(&NotifyAddress);
&langNotifyList.Push(¬ifyTo);
End-If;
End-If;
/*Start: Custom Code To Populate CC Value*/
¬ifyCC = 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);
¬ifyCC = CreateArrayRept(&FTNotifyAddressCC, 0);
¬ifyCC.Push(&FTNotifyAddressCC);
&FTlangNotifyListCC.Push(¬ifyCC);
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;
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';
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';
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.
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.
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
|
|
Add new or edit existing content reference links.
|
Related Links Group
|
PORTAL_RLNK_ADM
|
|
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:
Here are the steps to make it work after a change to the Portal or content URL's:
A. Undeploy/Redeploy any Search Definitions that were built with incorrect URL's as follows:
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'
- Navigate to PeopleTools, Search Framework, Administration, Schedule Search Index
- Bring up the Run Control needed to run a Full Index build and launch it.
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
Tuesday, April 22, 2014
Using Union All in PeopleSoft Query ( PSQuery )
When creating a PeopleSoft Query that uses a union, PeopleSoft will always use a union instead of a union all.
Using a Union statement causes the query to have all duplicate rows in the result set removed. In some cases this is appropriate but in many cases it is not. If another tool was being used, the Union statement would be changed to a Union All and then the duplicate rows would not be removed.
PSQuery does not provide a builtin way to change the Union to Union All, but I will show you two ways you can accomplish this on a Microsoft SQL Server database. ( This may work on Oracle or DB2 but I have not had a chance to test it )
Option 1: add a NewID() field
This is by far the simpler of the two options. To Accomplish this:
- Right click on "Expressions" and choose "New Expressions"
- Type newid() in the box
- Click OK
- Add this new expression as a field to select. (click on the fields tab, expand the expressions so you see the newly created one and drag it over to where the fields are listed)
- Repeated for each of your queries in the union
This method is quick and easy with only one drawback. Your query results will an extra column with text such as "37FCA8B1-E856-4C0D-8248-B4C417C35848" in it. If you are displaying the results of the query via a Crystal Report or nVision report, then just don't display this field and your problem is solved. If the end-user of this query is going to be using the PS Query tool and you do not want them to see this field, you should consider option 2 below.
Option 2: Hiding the union in a subselect
This method is more work but the results are great with no extra column. I have only had a chance to test this on MSSQL, so I don't know if it will work on Oracle or DB2. The main part of this workaround is to wrap the union that PSQUERY generates in a SubSelect and then force our own union all statement in it's place. PSQuery provides some flexibility in what you can put in an expression statement and we will use that to our advantage
Step 1:Create the first query
Create your first query in your union as usual
Step 2:Add a criteria at the bottom
Add an additional criteria at the bottom of your criteria list. Pick a field on the left hand side of the criteria and on the right side choose expression. If using an aggregate in your query you would need to add a new having criteria instead.
Step 3:Creating the first query expression
This is the tricky part. In the expression you just added. Type the Alias.Fieldname of the field you are selected, then type UNION ALL SELECT null,null where not exists (select 'x'
You must include the same number of nulls in your select statement here as in your first query. ( I have 2 in this example )
Step 4: Create the Second Query
Create your second query in the union as you normally would
Step 5: Create a new expression in the second query
Create a new blank expression in the second query. The datatype of this expression should match the datatype of the first field in your Fields to display
Step 6:
In the expression enter
null where 1 = 2
Union all
Select <FirstFieldName>
Union all
Select <FirstFieldName>
Replace <FirstFieldName> with the Alias.FirstFieldname in your Fields list
Step 7: Remove the first field and replace it will the expression
When you look at your sql you should be something like below
SELECT A.BUSINESS_UNIT, A.ORDER_NO
FROM PS_ORD_LINE A
WHERE A.ORDER_NO = A.ORDER_N
UNION ALL
SELECT null,null where not exists (select 'x' UNION SELECT null where 1 = 2 )
UNION ALL SELECT B.BUSINESS_UNIT, B.ORDER_NO
FROM PS_ORD_LINE B
FROM PS_ORD_LINE A
WHERE A.ORDER_NO = A.ORDER_N
UNION ALL
SELECT null,null where not exists (select 'x' UNION SELECT null where 1 = 2 )
UNION ALL SELECT B.BUSINESS_UNIT, B.ORDER_NO
FROM PS_ORD_LINE B
You can do this trick for as many unions as your need.
Tuesday, March 11, 2014
Excel 2010 Shortcuts
| Arrow Keys | Move one cell up, down, left, or right in a worksheet. |
| Page Down/Page Up | Move one screen down / one screen up in a worksheet. |
| Alt+Page Down/Alt+Page Up | Move one screen to the right / to the left in a worksheet. |
| Tab/Shift+Tab | Move one cell to the right / to the left in a worksheet. |
| Ctrl+Arrow Keys | Move to the edge of next data region (cells that contains data) |
| Home | Move to the beginning of a row in a worksheet. |
| Ctrl+Home | Move to the beginning of a worksheet. |
| Ctrl+End | Move to the last cell with content on a worksheet. |
| Ctrl+f | Display the Find and Replace dialog box (with Find selected). |
| Ctrl+h | Display the Find and Replace dialog box (with Replace selected). |
| Shift+F4 | Repeat last find. |
| Ctrl+g (or f5) | Display the 'Go To' dialog box. |
| Ctrl+Arrow Left/Ctrl+Arrow Right | Inside a cell: Move one word to the left / to the right. |
| Home/End | Inside a cell: Move to the beginning / to the end of a cell entry. |
| Alt+Arrow Down | Display the AutoComplete list e.g. in cell with dropdowns or autofilter. |
| End | Turn 'End' mode on. In End mode, press arrow keys to move to the next nonblank cell in the same column or row as the active cell. From here use arrow keys to move by blocks of data, home to move to last cell, or enter to move to the last cell to the right. |
| Select Cells | |
|---|---|
| Shift+Space | Select the entire row. |
| Ctrl+Space | Select the entire column. |
| Ctrl+Shift+* (asterisk) | Select the current region around the active cell. |
| Ctrl+a (or ctrl+Shift+spacebar) | Select the entire worksheet or the data-containing area. Pressing ctrl+a a second time then selects entire worksheet. |
| Ctrl+Shift+Page Up | Select the current and previous sheet in a workbook. |
| Ctrl+Shift+o | Select all cells with comments. |
| Shift+Arrow Keys | Extend the selection by one cell. |
| Ctrl+Shift+Arrow Key | Extend the selection to the last cell with content in row or column. |
| Shift+Page Down/Shift+Page Up | Extend the selection down one screen /up one screen. |
| Shift+Home | Extend the selection to the beginning of the row. |
| Ctrl+Shift+Home | Extend the selection to the beginning of the worksheet. |
| Ctrl+Shift+End | Extend the selection to the last used cell on the worksheet (lower-right corner). |
| F8 | Turn on extension of selection with arrow keys without having to keep pressing shift. |
| Shift+F8 | Add another (adjacent or non-adjacent) range of cells to the selection. Use arrow keys and shift+arrow keys to add to selection. |
| Shift+Backspace | Select only the active cell when multiple cells are selected. |
| Ctrl+Backspace | Show active cell within selection. |
| Ctrl+. (period) | Move clockwise to the next corner of the selection. |
| Enter/Shift+Enter | Move active cell down / up in a selection. |
| Tab/Shift+Tab | Move active cell right / left in a selection. |
| Ctrl+Alt+Arrow Right/Ctrl+Alt+Arrow Left | Move to the right / to the left between non-adjacent selections (with multiple ranges selected). |
| Esc | Cancel Selection. |
| Shift+Arrow Left/Shift+Arrow Right | Select or unselect one character to the left / to the right. |
| Ctrl+Shift+Arrow Left/Ctrl+Shift+Arrow Right | Select or unselect one word to the left / to the right. |
| Shift+Home/Shift+End | Select from the insertion point to the beginning / to the end of the cell. |
▲ up
| Ctrl+z | Undo last action (multiple levels). |
| Ctrl+y | Redo last action (multiple levels). |
| Ctrl+c | Copy contents of selected cells. |
| Ctrl+x | Cut contents of selected cells. |
| Ctrl+v | Paste content from clipboard into selected cell. |
| Ctrl+Alt+v | If data exists in clipboard: Display the Paste Special dialog box. |
| Ctrl+Shift+[+] | If data exists in clipboard: Display the Insert dialog box to insert blank cells. |
| F2 | Edit the active cell with cursor at end of the line. |
| Alt+Enter | Start a new line in the same cell. |
| Enter | Complete a cell entry and move down in the selection. With multiple cells selected: fill cell range with current cell. |
| Shift+Enter | Complete a cell entry and move up in the selection. |
| Tab/Shift+Tab | Complete a cell entry and move to the right / to the left in the selection. |
| Esc | Cancel a cell entry. |
| Backspace | Delete the character to the left of the insertion point, or delete the selection. |
| Delete | Delete the character to the right of the insertion point, or delete the selection. |
| Ctrl+Delete | Delete text to the end of the line. |
| Ctrl+; (semicolon) | Insert current date. |
| Ctrl+Shift+: (colon) | Insert current time. |
| Ctrl+t | Show all content as standard numbers. (So 14:15 becomes 14.25 etc for the entire file) To undo press ctrl + t again |
| Ctrl+d | Fill complete cell down (Copy above cell). |
| Ctrl+r | Fill complete cell to the right (Copy cell from the left). |
| Ctrl+" | Fill cell values down and edit (Copy above cell values). |
| Ctrl+' (apostrophe) | Fill cell formulas down and edit (Copy above cell formulas). |
| Ctrl+l | Insert a table (display Create Table dialog box). |
| Ctrl+- | Delete Cell/Row/Column Menu |
| Ctrl+- with row / column selected | Delete row / delete column. |
| Ctrl+Shift++ | Insert Cell/Row/Column Menu |
| Ctrl+Shift++ with row / column selected | Insert row/ insert column. |
| Shift+F2 | Insert / Edit a cell comment. |
| Shift+f10, then m | Delete comment. |
| Alt+F1 | Create and insert chart with data in current range as embedded Chart Object. |
| F11 | Create and insert chart with data in current range in a separate Chart sheet. |
| Ctrl+k | Insert a hyperlink. |
| enter (in a cell with a hyperlink) | Activate a hyperlink. |
| Ctrl+9 | Hide the selected rows. |
| Ctrl+Shift+9 | Unhide any hidden rows within the selection. |
| Ctrl+0 (zero) | Hide the selected columns. |
| Ctrl+Shift+0 (zero) | Unhide any hidden columns within the selection*. |
| Ctrl+` (grave accent) | Alternate between displaying cell values and displaying cell formulas. Accent grave /not a quotation mark. |
| Alt+Shift+Arrow Right | Group rows or columns. |
| Alt+Shift+Arrow Left | Ungroup rows or columns. |
| Ctrl+6 | Alternate between hiding and displaying objects. |
| Ctrl+8 | Display or hides the outline symbols. |
| Ctrl+6 | Alternate between hiding objects, displaying objects, and displaying placeholders for objects. |
| Note: there are no default shortcuts for this, but workaround through access keys from previous versions | |
| Alt+o, ca | Adjust Column width to fit content. Select complete column with Ctrl+Space first, otherwise column adjusts to content of current cell). Remember Format, Column Adjust. |
| Alt+o, cw | Adjust Columns width to specific value: Option, Cow, width |
| Alt+o, ra | Adjust Row height to fit content: Option, Row, Adjust |
| Alt+o, re | Adjust Row height to specific value: Option, Row, Height |
▲ up
| Ctrl+1 | Format cells dialog. |
| Ctrl+b (or ctrl+2) | Apply or remove bold formatting. |
| Ctrl+i (or ctrl+3) | Apply or remove italic formatting. |
| Ctrl+u (or ctrl+4) | Apply or remove an underline. |
| Ctrl+5 | Apply or remove strikethrough formatting. |
| Ctrl+Shift+f | Display the Format Cells with Fonts Tab active. Press tab 3x to get to font-size. Used to be ctrl+shift+p, but that seems just get to the Font Tab in 2010. |
| Alt+' (apostrophe / single quote) | Display the Style dialog box. |
| Ctrl+Shift+$ | Apply the Currency format with two decimal places. |
| Ctrl+Shift+~ | Apply the General number format. |
| Ctrl+Shift+% | Apply the Percentage format with no decimal places. |
| Ctrl+Shift+# | Apply the Date format with the day, month, and year. |
| Ctrl+Shift+@ | Apply the Time format with the hour and minute, and indicate A.M. or P.M. |
| Ctrl+Shift+! | Apply the Number format with two decimal places, thousands separator, and minus sign (-) for negative values. |
| Ctrl+Shift+^ | Apply the Scientific number format with two decimal places. |
| F4 | Repeat last formatting action: Apply previously applied Cell Formatting to a different Cell |
| Ctrl+Shift+& | Apply outline border from cell or selection |
| Ctrl+Shift+_ (underscore) | Remove outline borders from cell or selection |
| Ctrl+1, then Ctrl+Arrow Right/Arrow Left | Access border menu in 'Format Cell' dialog. Once border was selected, it will show up directly on the next Ctrl+1 |
| Alt+t* | Set top border |
| Alt+b* | Set bottom Border |
| Alt+l* | Set left Border |
| Alt+r* | Set right Border |
| Alt+d* | Set diagonal and down border |
| Alt+u* | Set diagonal and up border |
| *In Cell Format in 'Border' Dialog Window | |
| Alt+h, ar | Align Right |
| Alt+h, ac | Align Center |
| Alt+h, al | Align Left |
▲ up
| = | Start a formula. |
| Alt+= | Insert the AutoSum formula. |
| Shift+F3 | Display the Insert Function dialog box. |
| Ctrl+a | Display Formula Window after typing formula name. |
| Ctrl+Shift+a | Insert Arguments in formula after typing formula name. . |
| Shift+F3 | Insert a function into a formula . |
| Ctrl+Shift+Enter | Enter a formula as an array formula. |
| F4 | After typing cell reference (e.g. =E3) makes reference absolute (=$E$4) |
| F9 | Calculate all worksheets in all open workbooks. |
| Shift+F9 | Calculate the active worksheet. |
| Ctrl+Alt+F9 | Calculate all worksheets in all open workbooks, regardless of whether they have changed since the last calculation. |
| Ctrl+Alt+Shift+F9 | Recheck dependent formulas, and then calculates all cells in all open workbooks, including cells not marked as needing to be calculated. |
| Ctrl+Shift+u | Toggle expand or collapse formula bar. |
| Ctrl+` | Toggle Show formula in cell instead of values |
| Ctrl+F3 | Define a name or dialog. |
| Ctrl+Shift+F3 | Create names from row and column labels. |
| F3 | Paste a defined name into a formula. |
▲ up
| Shortcuts to delete, rename, or move worksheets are based on the old Excel 2003 menus which still work in Excel 2010. | |
| Shift+F11/Alt+Shift+F1 | Insert a new worksheet in current workbook. |
| Ctrl+Page Down/Ctrl+Page Up | Move to the next / previous worksheet in current workbook. |
| Shift+Ctrl+Page Down/Shift+Ctrl+Page Up | Select the current and next sheet(s) / select and previous sheet(s). |
| Alt+o then h r | Rename current worksheet (format, sheet, rename) |
| Alt+e then l | Delete current worksheet (Edit, delete) |
| Alt+e then m | Move current worksheet (Edit, move) |
▲ up
| F6/Shift+F6 | Move to the next pane / previous pane in a workbook that has been split. |
| Ctrl+F4 | Close the selected workbook window. |
| Ctrl+n | Create a new blank workbook (Excel File) |
| Ctrl+Tab/Ctrl+Shift+Tab | Move to next / previous workbook window. |
| Alt+Space | Display the Control menu for Main Excel window. |
| Ctrl+F9 | Minimize current workbook window to an icon. Also restores ('un-maximizes') all workbook windows. |
| Ctrl+F10 | Maximize or restores the selected workbook window. |
| Ctrl+F7 | Move Workbook Windows which are not maximized. |
| Ctrl+F8 | Perform size command for workbook windows which are not maximzed. |
| Alt+F4 | Close Excel. |
▲ up
| Ctrl+o | Open File. |
| Ctrl+s | Save the active file with its current file name, location, and file format. |
| F12 | Display the Save As dialog box. |
| f10 (or alt) | Turn key tips on or off. |
| Ctrl+p | Print File (Opens print menu). |
| F1 | Display the Excel Help task pane. |
| F7 | Display the Spelling dialog box. |
| Shift+F7 | Display the Thesaurus dialog box. |
| Alt+F8 | Display the Macro dialog box. |
| Alt+F11 | Open the Visual Basic Editor to create Macros. |
▲ up
| Ctrl+F1 | Minimize or restore the Ribbon.s |
| Alt/F10 | Select the active tab of the Ribbon and activate the access keys. Press either of these keys again to move back to the document and cancel the access keys. and then arrow left or arrow right |
| Shift+F10 | Display the shortcut menu for the selected command. |
| Space/Enter | Activate the selected command or control in the Ribbon, Open the selected menu or gallery in the Ribbon.. |
| Enter | Finish modifying a value in a control in the Ribbon, and move focus back to the document. |
| F1 | Get help on the selected command or control in the Ribbon. (If no Help topic is associated with the selected command, the Help table of contents for that program is shown instead.) |
▲ up
| Tab/Shift+Tab | Move to the next / previous field which can be edited. |
| Enter/Shift+Enter | Move to the first field in the next / previous record. |
| Page Down/Page Up | Move to the same field 10 records forward / back. |
| Ctrl+Page Down | Move to a new record. |
| Ctrl+Page Up | Move to the first record. |
| Home/End | Move to the beginning / end of a field. |
▲ up
| Arrow Keys | Navigate inside Pivot tables. |
| Home/End | Select the first / last visible item in the list. |
| Alt+c | Move the selected field into the Column area. |
| Alt+d | Move the selected field into the Data area. |
| Alt+l | Display the PivotTable Field dialog box. |
| Alt+p | Move the selected field into the Page area. |
| Alt+r | Move the selected field into the Row area. |
| Ctrl+Shift+* (asterisk) | Select the entire PivotTable report. |
| arrow keys to select the cell that contains the field, and thenalt+Arrow Down | Display the list for the current field in a PivotTable report. |
| arrow keys to select the page field in a PivotChart report, and then alt+Arrow Down | Display the list for the current page field in a PivotChart report. |
| Enter | Display the selected item. |
| Space | Select or clear a check box in the list. |
| Ctrl+tab ctrl+Shift+Tab | select the PivotTable toolbar. |
| enter then arrow down /Arrow Up | On a field button: select the area you want to move the selected field to. |
| Alt+Shift+Arrow Right | Group selected PivotTable items. |
| Alt+Shift+Arrow Left | Ungroup selected PivotTable items. |
▲ up
| Arrow Keys | Move between options in the active drop-down list box or between some options in a group of options. |
| Ctrl+Tab/Ctrl+Shift+Tab | Switch to the next/ previous tab in dialog box. |
| Space | In a dialog box: perform the action for the selected button, or select/clear a check box. |
| Tab/Shift+Tab | Move to the next / previous option. |
| a ... z | Move to an option in a drop-down list box starting with the letter |
| Alt+a ... alt+z | Select an option, or select or clear a check box. |
| Alt+Arrow Down | Open the selected drop-down list box. |
| Enter | Perform the action assigned to the default command button in the dialog box. |
| Esc | Cancel the command and close the dialog box. |
| Alt+Arrow Down | On the field with column head, display the AutoFilter list for the current column . |
| Arrow Down/Arrow Up | Select the next item / previous item in the AutoFilter list. |
| Alt+Arrow Up | Close the AutoFilter list for the current column. |
| Home/End | Select the first item / last item in the AutoFilter list. |
| Enter | Filter the list by using the selected item in the AutoFilter list. |
| Ctrl + Shift + L | Apply filter on selected column headings. |
| Arrow Keys | Select elements. |
| Esc | Remove Focus from Selection. |
| F2 | Edit Selection Text in if possible (in formula bar). |
Subscribe to:
Posts (Atom)