Thursday, August 27, 2009

Dynamic Dropdown in PS

In the "PeopleCode API Reference" PeopleBook, it mentions how to do dynamic dropdowns:

1. Define a field in the DERIVED record called fieldname.
2. In the record definition for the field you want to have a dynamic prompt table, define the prompt
table for the field as %PromptField,where PromptField is the name of the field you created in the
DERIVED record.
Note. When you use SetEditTable, you don’t have to add a hidden field to the page.
3. Use SetEditTable to dynamically set the prompt table.
%PromptField is the name of the field on the DERIVED work record. RECORD.recordname is the name of
the record to be used as the prompt table.
&REC.SetEditTable("%EDITTABLE1", Record.DEPARTMENT);
&REC.SetEditTable("%EDITTABLE2", Record.JOB_ID);
&REC.SetEditTable("%EDITTABLE3", Record.EMPL_DATA);
&REC.ExecuteEdits();
Since I am new to PS (this is probably my 8th months in), it's not easy for me to understand it. Been online looking for examples, but no much help found. After about 3 hours of playing, I finally made it work. Here is how:

First, I will show you the final look and feel so it's easier to explain:

I want use that "Long Name" field as the one for the dynamic drop-down. I will code it to prompt against the JOB_CODE table.








Here the SZ_PJ2_RC1 is my main record.





Now I set it to prompt against the EditTable3 Field of the DERIVED record.











Next, I will drop the new field (SZ_PJ2_FD1) to my page, along with DERIVED.EDITTABLE3. (The PeopleBook says "Note. When you use SetEditTable, you don’t have to add a hidden field to the page.", but I just could not make it to work, I had to add it. If you know how to not the hidden field, please let me know). The "Third Edit Table" is DERIVED.EDITTABLE3, I am making it hidden.


Last step, writing PeopleCode. In this case, I am putting the PeopleCode in the FieldDefault event in my SZ_PJ2_FD1 field.



Now try it online. You see the magnifying glass next to "Long Name". Clicking on it.








Now you see the look-up page. Notice it says "Look Up Long Name", that's my field. Notice also the dropdown there says "Job Code", so it's pulling data from Job Code table. I then chose the 2nd one from the results - 120000.












The original page will have my value. Clicking on the Save button, no error. Let's check what's in the database now:






Cool, I have120000 in there now.



-- End.

Tuesday, August 25, 2009

Trace in PS

To turn on online trace, add "&trace=Y" at the end of the login URL, for example, if your login URL is:

https://www.yoursite.com/instance_name/?cmd=login

You will need to do this:

https://www.yoursite.com/instance_name/?cmd=login&trace=Y

This should bring you to a login page where you can specify the trace options.

This trace will stop when your session is complete. Be careful with this, the trace file could grow very large.

The trace file should be under the app server's log directory.

PS login

PS login is the login userid/password we use to log into PS web portal as well as App Designer. It's different from our Oracle user id/password.

Tuesday, April 14, 2009

PS bits

In one application, we have a form, on the form, there is a field which should be pre-populated with email address, here is what's done to get it:

In the Record PeopleCode, EMAILID field's FieldDefault and RowInit actions:
WC_HRF_NE_TERM.EMAILID = %EmailAddress;

Another field is filled with user ID, which is done:

In the Record PeopleCode, OPRID field (that's the field we fill with user ID)'s FieldDefault, RowInit, SearchInit and SearchSave actions:
WC_HRF_NE_TERM.OPRID = %OperatorId;

Friday, March 20, 2009

Boobooke training

You can use SQLPlus to connect to an idle instance. Then you issue "startup" to start the database.

>sqlplus /nolog ------ [[I realized that we did not specify the SID, how is that?]]
SQL>conn / as sysdba
connected to an idle instance
SQL>startup
Oracle instance started.

Total System Global area.....
....
Database mounted.
Database opened.
SQL> select * from v$sga_dynamic_components;


At this point, the database is started. Now you need to start listener:

> lsnrctl start


After this one is done, you can connect to the database from other machine.

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

Initialization Parameter Files, two of them; one is PFILE; one is SPFILE; PFILE is a text, initSID.ora (Here SID is the SID for your instance), it's under $ORACLE_HOME/dbs (under windows it's $ORACLE_HOME/database); only takes affect after restart.

v$parameter, this table has all the parameters in it. For those parameters, you can use

show parameter sga;


It will try show you all parameters containing "sga".

SQL> col name format a10;
name is the name of the column. a10 is ascii 10 char;

SQL>connect / as sysdba;
connected to an idel instance

at this step, the db is in shutdown mode; if you check the process, you will only see that the command above actually started a listener process:

oracle 3989 3987 3 22:47 pts/0 00:00:00 oraclewilson (DESCRPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))


also you can issue "ipcs" command in unix environment, and it will show you that the shared memory is not allocated b/c it's still in the shutdown mode.

Now if you start it up:

SQL>startup nomount;
ORACLE instance started.

Total System Global Area 236....... bytes.
Fixed Size...
....
SQL>


At this moment, if you ps -afe, you will see a lot of background processes are started:
ora_pmon_wilson
ora_dbw0_wilson
...

and ipcs will show that the shared memory segments, Semaphore Arrays are assigned.
And since it's nomount, no database is connected to this instance yet. All the settings in the spfile have been read and applied. You can query them through the "show parameter " sqlplus command.

Next is the mount step.
The instance mounts a database to associate the database with that instance. To mount the database, the instance finds the database control files and opens them. Control files are specified in the CONTROL_FILES initialization parameter in teh parameter file used to start the instance. Oracle database then reads the cotnrol files to get the names of the database's datafiles and redo log files. At this point, database is still closed and is accessible only to the database admin. The database admin can keep the db closed while completing specific maintenance operations. However, the db is not yet available for normal operations.

Now how do we mount the database?
SQL> alter database mount;
Database altered.
SQL>

Next mode is the OPEN mode. All files are opened as described by the control file for this instance.

Opening a mounted db makes it available for normal database operation. Any valid user can connect to an open db and access its information. Usually, a db admin opens the db to make it available for general use.
When you open the db, Oracle Database opens the online datafiles and redo log files. If a tablespace was offline when the database was previously shut down, the tablespace and its corresponding datafiles will still be offline when you reopen the database.
If any of the datafiles or redo log files are not present when you attempt to open the database, then Oracle Database returns an error. You must perform recovery on a backup of any damaged or missing files before you can open the database.
To open a database, you do

SQL> alter database open;
Database altered.
SQL>


ALTER DATABASE db01 MOUNT;
ALTER DATABASE db01 OPEN READ ONLY;

Note, you can only go from nomount -> mount -> open, can't go other way around.

You can do this also:

SQL>startup mount;
At this point, you can not change it to unmount:
SQL> alter database unmount;
this will give you an error.
SQL>startup RESTRICT
Or you can change it to restricted mode:
SQL>alter system enable restricted session;
To start a listener, do this:
lsnrctl start

sqlplus system/oracle@oracle9ivm
To kick a user out, all the sessions are in the v$session table.
SQL> select saddr, sid, serial#, username from v$session;
SQL> alter system kill session '15,6';
Here 15 is the sid, 6 is the serial#.


Table v$transaction contains the data not committed. If you do some transaction (insert), but do not commit it, you will see the entry in the v$transaction; if you then commit it, you will see it's gone from that table.

conn id/password as anotherid
To run a script
SQL> @$ORACLE_HOME/dbs/crdb01.sql;
SQL> @?/rdbms/admin/catalog.sql
In above, the ? is the same as $ORACLE_HOME.









Wednesday, March 18, 2009

Misc stuff

Some resources:

Navigating the Component Buffer

PSOPRDEFN has all the user logins.

Monday, March 9, 2009

Microsoft loopback adapter error when installing 11g

I got this error when I tried to install it. I had to set my pc to static ip address to get it work. However I just found that it's been address by Oracle here.
http://blogs.oracle.com/OCP10to11/2009/03/microsoft_loopback_adapter_err.html

Friday, February 27, 2009

Installing PeopleSoft softwares

This is a big topic. I found this on Oracle site; specifically, I am interested in PeopleTools 8.49 Installation for Microsoft SQL Server. The reason I choose SQL Server is that I have MSDN subscription which gives me the advantage of being able to download one from MS. I also have the Oracle Metalink (?) account, but I don't know if that will give me some demo Oracle database or not. If I can get an Oracle database to installed, I will try it later. For now, I will go with SQL server.

First thing, reading the PDF manual above. Here are notes I took down while reading:
To download software and documentation, use the Oracle Technology Network.

Side note, I went to the Technology Network, and found that they have a Oracle Database 10g Express Edition. Seems to be good candidate for me.

Now I have it installed. I also have the Oracle Database 10g Express Edition Client installed as well. Did a small example application, it turned out pretty neat.

While reading a page at itpub, I found info about PeopleSoft 下载地址 and 注册码. It's kinda neat as well.

Another helpful page.

Q: 在PSFT上,如何建立一个用户Application Designer连DB时只有只读权限,但不能修改对象
A: application designer是用application的帐户登录的,你可以在数据库中设置这个用户对于哪些表有只读权限.


在Oracle10g上装PeopleSoft DB

Here is How to set up a PeopleSofter Environment -- by Snowhite2000
1.A Peoplesoft environment includes the following servers:
1) Database Server
You can choose the most common database server you like: Oracle, SQL Server, IBM DB2, informix.......
To set up a database server is the most important part of PS environment. It is 70% weight in a PS environment.
2) Application Server
PS use BEA Tuxedo as its Application Engine
3) Scheduler
Scheduler is used to run report. Also use BEA Tuxedo as Engine.
4) Web Server
You can pick BEA Weblogic or IBM Websphere as Web Server.
5) File Server
6) Workstations for power user

2. Software needed for a Peoplesoft Environment
You can pick different OS -- Windows, Unix, Linux. But each serve need to be installed the following list of Software.
1) Database Server:
BEA Tuxedo
Database Server: Oracle/SQL Server/IBM DB2......
PeopleSoft PeopleTools for database Server
PeopleSoft Applications (Finanical/HRMS/CRM .....)
2) Application Server:
BEA Tuxedo
PeopleSoft PeopleTools for Application Server
Database Client
3) Process Sheduler (Batch Server)
BEA Tuxedo
PeopleSoft PeopleTools for Seheduler
Database Client
4) File Server
PeopleSoft PeopleTools for File Server
5) Web Server
BEA tuxedo
Database Client
Web Server: BEA Weblogic/IBM Webspere
PeopleSoftPeopleTools for Web Server
6) Workstations for power user:
Database Client (With ODBC)
Crystal report (if needed)
7) Other Software:
Database Server:
A PeopleSoft Software package includes all above software except Database Server. You should purchase Database Server license youself.
Cobol Compiler:
PS also use some Cobol. You need purchase a Cobol compiler such as Net Express for Windows and Micro Focus for Unix.
FTP Server:
You may/maynot need it. It depends on how you like to transfer your report between process scheduler and Web Server

3. install workstation (map to your file server drive and install from there)

4. Create a DEMO database:

After all software has been install on the Server, we start to create a demo database.
The process of database creating is base on the database engine you use. I cannot give out the detail about this part. This part takes most of your time. Some scripts need 10 more hours to run.

5. Configure Application Server

6. Configure Process Scheduler

7. Setting up PIA (PeopleSoft Pure Internet Architecture) on Web Server

8. Setting up Crystal report (if needed)

9. Compile your Cobol

10. Installing Peoplebook -
(I do have one note about it which i worte last year: http://snowhite2000.itpub.net/post/5/3612)

My note:
1. If it is your first to create PS environment, plus, you need create demo database, you should ask minimum 2 weeks or more to finish all tasks.
2. Strong background of OS and network will be most helpful.

下载下来的每一个 Maintenance Pack 里面都有很详细的 Word 文件,告诉你一步一步怎么做。有些步骤还有截屏。一步一步对照找做。注意不能出错误就好了。
不过你要决定,你的环境是否需要 MP. 这个通常是 function 组的决定。
======================
还有需要注意的事情就是,如果你的环境有很多已经 customized 的功能,你在 applied MP 之后,这些功能可能需要重新再 customize 一次。类似作了一次小小的升级的意思。

Another one on 共享PSFT HRMS安装的资料

Starting on PeopleSoft

Although I have been wanting to get into PeopleSoft area for a long time, I never had a chance. My boss wanted me to take care of other her projects, so I have worked on Unix, Windows, Java, .Net, Apache, Tomcat, IIS, etc. I did have a short period of time working on PS, mainly on SQRs. Now I am very excited that my boss is putting me on PeopleSoft officially. I will be working on our PS international side. Currently we have PT8.46, not sure what PS version is, maybe 8.9. We are talking about upgrading it to 8.9 or 9.

Thanks to my boss, I have taken 2 PeopleSoft trainings here in Atlanta Oracle training center. One on PeopleTools I & II expedited, the other Application Engine. I wanted to take on PeopleCode but she wouldn't be able to get more money for me. Well, that's already great for me.

Now I feel boring reading the PeopleBooks. I am thinking of installing everything on my PC and trying it out.