Search This Blog

Wednesday, October 27, 2010

Enable page Anchor

Just a quick thought of sharing this info. you would have heard about 'Enable page Anchor'. how to achive this.

1. The Anchor fields should be a Push Button or Hyperlink
2. On the General tab, Check the box, Enable as Page Anchor and give the Page Filed Name as 'Anchor1' (upto us)
3. Keep this button at the top of the page
4. Create one more field with the same properties (Give the page field name as Anchor2)

5. On both the fields, change the destination (on the Type tab) to Page Anchor
6. Once done, Action tab will be enabled on the same Type tab
7. Give the Action Type as Page Anchor
8. Give 'Related Control' as Anchor 2 for Anchor1 field and Anchor1 for Anchor2 field

Once done, if you click on Anchor1, the control goes to Anchor2 and vice versa.

Mani

Thursday, October 14, 2010

Customizing the Help Link

I have seen one requirement from the client, who needs to have their own custom help documents to be displayed along with the PeopleBooks hyperlink, when clicked on the help link. The only way to do it was to track down, from where the PeopleBooks data is being pulled from and add those client customized docs into the folder.

How to do the same? There is a post in the PeopleSoft pros website, where Derek Tomei explains how to accomplish this task.

His blog post is given below:

Using Custom Documentation as PeopleBooks:

Prior to creating custom PeopleBooks, you need to divide documentation and/or training manuals into logical units. For example, if you have a custom component with three custom pages, and the functionality of all three pages is contained within one training document, three distinct documents would have to be created. The information for each page would be used to create an .htm document (.pdf and .doc documents can also be used but .htm is better for searching). Copying the documentation for a page into a Word Web Page template does this.

If, for example, the three custom pages are Query_1, Query_2 and Query_3, the three .htm documents can be saved as qry01.htm, qry02.htm and qry03.htm. It is important, especially if there are numerous custom pages, to use a naming convention that is easy to keep in the order of the pages you are going to attach them to.

Here are 6 Easy Steps to Create Custom PeopleBooks
The following steps detail how to create custom PeopleBooks:

Step 1: Create a new folder, for example Query817, under the weblogic folder on your Web Server. The navigation for PeopleTools 8.1x should be weblogic\ myserver\public_html \htmldoc\eng. This is the same location as the psbooks folder that holds the delivered PeopleBooks.

Step 2: Create a folder under Query817 called Query. In this folder, create a .htm folder and copy the .htm custom query files here. The PeopleSoft delivered Query PeopleBooks are .htm documents and are located under psbooks\tpsq\htm.

Step 3: Copy the contextids folder from a delivered PeopleBooks folder, with all of it’s content, to the custom Query folder that was just created.

Step 4: Modify the content of Query\contextids\q (javascript file). Use q because all of the pages that will have custom documentation begin with Q. The name of this javascript file must match the first letter of the name of the page that will be accessing the documentation. Open the file in Notepad and use the following format to add the custom PeopleBooks. Delete or comment out the delivered code:

o The item in bold is the page name of the page that you are linking a particular .htm file to. This is easy to find by navigating to your custom PeopleSoft page and clicking the HELP link. Since there is currently no PeopleBooks for this custom page, a message will appear stating the nothing could be found for :

bookmarks[bookmarks.length] = "QRY_CRITERIA_FIELD||Query817/Query/htm/qry03.pdf#F1ID_QRY_CRITERIA_FIELD";

o After the page name, the path to the file that contains the documentation for the page:

bookmarks[bookmarks.length] = "QRY_CRITERIA||Query817/Query/htm/qry03.htm#F1ID_QRY_CRITERIA";

o After the file path, the name of the file containing the documentation for the page:

bookmarks[bookmarks.length] = "QRY_FIELDS_SEC||Query817/Query/htm/qry02.htm#F1ID_QRY_FIELDS_SEC";

o After the file name, #F1ID_ and the name of the page:

bookmarks[bookmarks.length] = "QRY_FIELDS||Query817/Query/htm/ qry 02. htm #F1ID_QRY_FIELDS";

bookmarks[bookmarks.length] = "QRY_PROMPT||Query817/Query/htm/qry 02. htm #F1ID_QRY_PROMPT";
bookmarks[bookmarks.length] = "QRY_PROMPT_SELECT||Query817/Query/htm/qry 02. htm #F1ID_QRY_PROMPT_SELECT";
bookmarks[bookmarks.length] = "QRY_PROPERTIES||Query817/Query/htm/qry 05.htm#F1ID_QRY_PROPERTIES";
bookmarks[bookmarks.length] = "QRY_QUERY_HIERJOIN||Query817/Query/htm/qry 05.htm#F1ID_QRY_QUERY_HIERJOIN";
bookmarks[bookmarks.length] = "QRY_QUERY||Query817/Query/htm/qry 01.htm#F1ID_QRY_QUERY";

arraycount[arraycount.length] = bookmarks.length - 1;

These entries link the online Query pages to the corresponding custom PeopleBooks .htm file in the new folder (as described above).

Step 5: Update the following javascript files under weblogic\myserver\public html\htmldoc\eng\js:

o colltypes
o doctypes
o helptypes

In each of these files add the following (in bold):

helptypes = new Array(
"psbooks||PeopleBooks",
"dftie||Transactional Help",
"Query817||Query"
);


Step 6: Update the following javascript files under weblogic\myserver\public html\htmldoc\eng\psbooks\js:

o booklist
o colllist
o helplist

For example, in colllist, insert the following code:

o colllist[colllist.length]="Query817/Query||PeopleTools 8.17:Query||eng/Query817/Query/coll||";

In booklist, insert the following code:

o booknames[booknames.length]="Query817/Query||PeopleTools 8.17: Query";

In helplist, insert the following code:

o helpnames[helpnames.length]="Query817/Query||PeopleTools 8.17: Query";

Conclusion:
Now, the custom PeopleBooks will be accessible through the HELP link when the user is in the custom Query page. Follow these procedures for any custom PeopleBooks that you want to create for your custom pages.

Wednesday, October 13, 2010

Auto Saving the PeopleSoft page using JavaScript

It was one year back, while I was working with my previous company, one of my colleague implemented an auto save functionality for Performance appraisal data entry page. The requirement was to provide an auto save in the peoplesoft page after a certain interval, as there happened some instances, which the employees enter big novels about their performance and by mistake they close without saving the page.

Just now I thought of searching for that code around and I got it from will bailey it toolbox thread. Download the code below. This is an example for jQuery implementation also.

Saturday, October 9, 2010

iScripts

This is an area which I never worked before. This blog post by Jim gives you the best on iScripts. Go ahead and read the same.


Below screenshot gives you the difference between a regular URL and an iScript URL.




How do I create one?

--Create the PeopleCode in a Weblib

--Add Security for your IScript

--Create the link for your IScript


Create the PeoplCode in a Weblib

--Weblib’s are like Funclibs. They should be Derived Work Records. Usually a single field (Funclib) is enough.

--Place your code in the FieldFormula Event

--Each Iscript Function must begin with the string Iscript_ (i.e. Iscript_HellowWorld)


Add The Security

--Access to Weblibs is granted via Permission Lists

--Special Weblib tab on the Permission List tab

--Access is granular to the Iscript (Function) level


Create the Link

--Where am I accessing the weblib from?

--If from PeopleCode/Page use Button HyperLink type field of at least 254 length!

--Set as External Link, Dynamic URL

--Use deleivered functions to set field value. (i.e. GenerateScriptContentURL)

--Or you can use a Content Reference.


Few points worth to be noted:

--you can generate an IScript URL using the PeopleCode built-in function GenerateScriptContentURL.

--if you just want to view/print the component without the header and menu, then you can use the GenerateComponentContentURL function to create a URL to the component that does not include the portal markup. The GenerateComponentContentURL function creates a URL that matches the CREF's URL but uses the psc servlet rather than the psp servlet.


--"is this a psp or psc URL? I ask because this makes a difference in regards to the URL you see in the browser. If it is psp, then what you are seeing is the URL to your iScript plus the portal information. In this case, the actual URL to the content is in an iframe. If you use the psc URL, then you bypass the portal frameset and go direct to the content."


Anoop Savio

Thursday, October 7, 2010

ANALYZE & compute statistics

%Execute(/) ANALYZE TABLE PS_CLASS_TBL compute statistics/ ANALYZE TABLE PS_CLASS_ATTRIBUTE compute statistics/ ANALYZE TABLE PS_CLASS_MTG_PAT compute statistics/ ANALYZE TABLE PS_CLASS_CHRSTC compute statistics/ ANALYZE TABLE PS_CLASS_COMPONENT compute statistics/ ANALYZE TABLE PS_CLASS_ASSOC compute statistics/ ANALYZE TABLE PS_CRSE_OFFER compute statistics/ ANALYZE TABLE PS_CU_CLAS_NBR_STG compute statistics/

I didnt get it first when I saw the above SQL. It had a clue that, its something realted to the performance tuning. Given a search, got the below info from the Stanford site.

ANALYZE
Purpose
--Use the ANALYZE statement to collect statistics, for example, to:
--Collect or delete statistics about an index or index partition, table or table partition, index-organized table, cluster, or scalar object attribute.
--Validate the structure of an index or index partition, table or table partition, index-organized table, cluster, or object reference (REF).

--Identify migrated and chained rows of a table or cluster.

More indepth info on the same.

Lokesh Madnavat

Wednesday, October 6, 2010

Disable Browser Caching in PeopleSoft

Going through the alliance presentation, just came across the point: Disabling Browser Caching in PeopleSoft. Got the below information from learnpsdba blog.

A browser will cache various pages and states in memory to increase performance. It may be necessary to disable these performance features on the browser for security reasons. Note that once caching is disabled, the Back button on the browser stops working in PIA.
To disable caching:
1. In PIA, navigate to PeopleTools, Web Profile, Web Profile Configuration.
2. Select the web profile that you want to configure; for example, PROD.
3. Select the Caching page.
4. Make sure that the "Cache Generated HTML" and "Cache Homepage" check boxes are both cleared.
5. Save your changes

Tuesday, October 5, 2010

About DBMS_STATS Usuage

To be frank, This is for the first time I coming across this code below:

EXECDBMS_STATS.GATHER_TABLE_STATS(ownname=>'SYSADM',tabname=>'PS_TEST_LOAD'
,estimate_percent=>10,CASCADE=>TRUE,NO_INVALIDATE=>FALSE)


Gave a search in google and found the info from the Burleson Consulting site.

Note: You should never use the default dbms_stats statistics collection mechanism with Oracle. Just like the initialization parameters, the statistics collection should be customized to your specific needs. For details, see my latest book "Oracle Tuning: The Definitive Reference" and these notes on 11g extended optimizer statistics.

When a SQL statement is executed, the database must convert the query into an execution plan and choose the best way to retrieve the data. For Oracle, each SQL query has many choices for execution plans, including which index to use to retrieve table row, what order in which to join multiple tables together, and which internal join methods to use (Oracle has nested loop joins, hash joins, star joins, and sort merge join methods). These execution plans are computed by the Oracle cost-based SQL optimizer commonly known as the CBO.

The choice of executions plans made by the Oracle SQL optimizer is only as good as the Oracle statistics. To always choose the best execution plan for a SQL query, Oracle relies on information about the tables and indexes in the query.Starting with the introduction of the dbms_stats package, Oracle provides a simple way for the Oracle professional to collect statistics for the CBO. The old-fashioned analyze table and dbms_utility methods for generating CBO statistics are obsolete and somewhat dangerous to SQL performance because they don't always capture high-quality information about tables and indexes. The CBO uses object statistics to choose the best execution plan for all SQL statements.The dbms_stats utility does a far better job in estimating statistics, especially for large partitioned tables, and the better stats result in faster SQL execution plans. Andrew Holdsworth of Oracle Corporation notes that dbms_stats is essential to good SQL performance, and it should always be used before adjusting any of the Oracle optimizer initialization parameters:

“The payback from good statistics management and execution plans will exceed any benefit of init.ora tuning by orders of magnitude”

Below is a sample execution of dbms_stats with the options clause.

exec dbms_stats.gather_schema_stats( -ownname => 'SCOTT', -options => 'GATHER AUTO', -estimate_percent => dbms_stats.auto_sample_size, -method_opt => 'for all columns size repeat', -cascade => true, -degree => 15 -)

Here is a representative example of invoking dbms_stats in 10g:

DBMS_STATS.gather_schema_stats(ownname=>’’,estimate_percent=>dbms_stats.
auto_sample_sizecascade=>TRUE,method_opt=>’FOR ALL COLUMNS SIZE AUTO’)


To fully appreciate dbms_stats, you need to examine each of the major directives. Let’s take a close look at each directive and see how it is used to gather top-quality statistics for the cost-based SQL optimizer.The options parameterUsing one of the four provided methods, this option governs the way Oracle statistics are refreshed:

gather—Reanalyzes the whole schema
gather empty—Only analyzes tables that have no existing statistics
gather stale—Only reanalyzes tables with more than 10% modifications (inserts, updates, deletes).
gather auto—Reanalyzes objects which currently have no statistics and objects with stale statistics (Using gather auto is like combining gather stale and gather empty.)


Note that both gather stale and gather auto require monitoring. If you issue the alter table xxx monitoring command, Oracle tracks changed tables with the dba_tab_modifications view, which allows you to see the exact number of inserts, updates, and deletes tracked since the last analysis of statistics.

The estimate percent option
The following estimate_percent argument is a new way to allow Oracle’s dbms_stats to automatically estimate the best percentage of a segment to sample when gathering statistics:

estimate_percent => dbms_stats.auto_sample_size
You can verify the accuracy of the automatic statistics sampling by looking at the dba_tables sample_size column. It is interesting to note that Oracle chooses between 5 and 20 percent for a sample size when using automatic sampling. Remember, the better the quality of your statistics, the better the decision of the CBO.

The method_opt option
The method_opt parameter for dbms_stats is very useful for refreshing statistics when the table and index data change. The method_opt parameter is also very useful for determining which columns require histograms.

In some cases, the distribution of values within an index will effect the CBOs decision to use an index versus perform a full-table scan. This happens when a where clause has a disproportional amount of values, making a full-table scan cheaper than index access.

Oracle histograms statistics can be created when you have a highly skewed index, where some values have a disproportional number of rows. In the real world, this is quite rare, and one of the most common mistakes with the CBO is the unnecessary introduction of histograms in the CBO statistics. As a general rule, histograms are used when a column's values warrant a change to the execution plan.

To aid in intelligent histogram generation, Oracle uses the method_opt parameter of dbms_stats. There are also important new options within the method_opt clause, namely skewonly, repeat and auto:

method_opt=>'for all indexed columns size skewonly'
method_opt=>'for all columns size repeat'
method_opt=>'for columns size auto'

The skewonly option is very time-intensive because it examines the distribution of values for every column within every index.

If dbms_stats discovers an index whose columns are unevenly distributed, it will create histograms for that index to aid the cost-based SQL optimizer in making a decision about index versus full-table scan access. For example, if an index has one column that is in 50 percent of the rows, a full-table scan is faster than an index scan to retrieve these rows.

--*************************************************************

-- SKEWONLY option
—Detailed analysis
---- Use this method for a first-time analysis for skewed indexes
-- This runs a long time because all indexes are examined--*************************************************************

begin dbms_stats.gather_schema_stats( ownname => 'SCOTT', estimate_percent => dbms_stats.auto_sample_size, method_opt => 'for all columns size skewonly', cascade => true, degree => 7 );end;

If you need to reanalyze your statistics, the reanalyze task will be less resource intensive with the repeat option. Using the repeat option will only reanalyze indexes with existing histograms, and will not search for other histograms opportunities. This is the way that you will reanalyze you statistics on a regular basis.

--**************************************************************

-- REPEAT OPTION - Only reanalyze histograms for indexes
-- that have histograms---- Following the initial analysis, the weekly analysis
-- job will use the “repeat” option. The repeat option
-- tells dbms_stats that no indexes have changed, and

-- it will only reanalyze histograms for-- indexes that have histograms.--**************************************************************

begin dbms_stats.gather_schema_stats( ownname => 'SCOTT', estimate_percent => dbms_stats.auto_sample_size, method_opt => 'for all columns size repeat', cascade => true, degree => 7 );end;

The auto option within dbms_stats is used when Oracle table monitoring is implemented using the alter table xxx monitoring; command. The auto option, shown in Listing D, creates histograms based upon data distribution and the manner in which the column is accessed by the application (e.g., the workload on the column as determined by monitoring). Using method_opt=>’auto’ is similar to using the gather auto in the option parameter of dbms_stats.

begin dbms_stats.gather_schema_stats( ownname => 'SCOTT', estimate_percent => dbms_stats.auto_sample_size, method_opt => 'for all columns size auto', cascade => true, degree => 7 );end;

Parallel collection

Oracle allows for parallelism when collecting CBO statistics, which can greatly speed up the time required to collect statistics. A parallel statistics collection requires an SMP server with multiple CPUs.

Better execution speed

The dbms_stats utility is a great way to improve SQL execution speed. By using dbms_stats to collect top-quality statistics, the CBO will usually make an intelligent decision about the fastest way to execute any SQL query. The dbms_stats utility continues to improve and the exciting new features of automatic sample size and automatic histogram generation greatly simplify the job of the Oracle professional.

Anoop Savio

Friday, October 1, 2010

Feed dashboard in your PIA

This might be the simplest code you can ever create.

This is about creating a feed page in the PeopleSoft instance, which will pull up your favorites as rss feeds.

I created a small sample one while working with my previous company. The intention was to pull up the news feeds from my favorite news sites, which I can take up a glance without navigating away from the PIA.

It was done in two ways. One using Pagelet wizard and using the HTML area.
Then you can create a page which exactly serves the purpose of Google news, right on your PeopleSoft homepage.

How to make it is a very simple task. Pick up any feed link from your favorite site and use the following link to create the RSS feed HTML script to embed in Pagelet wizard or in the html area.

I used: http://www.rss-to-javascript.com/p/RSSRDF-Converter___138.html to create the embedding script.

So how to create the embed script for MyTechSpeak PeopleSoft site?

You can see a feed icon on the navigation bar of the site.



Right click on it and click on the copy shortcut option. You will get the following link: http://mytechspeak.blogspot.com/feeds/posts/default

Now go to the link: http://www.rss-to-javascript.com/p/RSSRDF-Converter___138.html and follow the screenshots below:



Click on the generate javascript button to get the embed code.



Now after embedding the above code in Pagelet or html area, it will look like this. This will be automatically updated with the sites status.stay connected.



Try it. It’s fun, simple and useful. Even you can create a kind of google news inside your pia :)