Tuesday, 22 July 2014

How To set Multiple Related Display Fields in Grid on Peoplesoft Pages:


There could be chances that we are required to access the related display field on grid. If there is only one record field as related display then its fine, no problem there. But it is complicated when there are multiple related displays from the same record fields.

Let us say that in one of the grid we want to show the names for JOB.SUPERVISOR_ID and JOB.EMPLID and these fields are display control fields and related fields for both is PERSON_NAME.NAME so referencing the related field of JOB.SUPERVISOR_ID will be an issue with the grid referencing syntax as it will reference the related field of JOB.EMPLID also.

Now here is the syntax for the same:

Let row of that field is &Grid_Row

Now accessing the related field of JOB.SUPERVISOR_ID:

&Grid_Row. JOB.SUPERVISOR_ID.GetRelated (PERSON_NAME.NAME).value;

Now accessing the related field of JOB.EMPLID:

&Grid_Row. JOB.EMPLID.GetRelated (PERSON_NAME.NAME).value

Dynamic Role In PeopleSoft


Roles (and permission lists) can be assigned to users dynamically in PeopleSoft using dynamic role rules. The logic used to assign a dynamic role can be in the form of query, PeopleCode or directory (e.g. LDAP) rule.

The application engine program DYNROLE_PUBL assigns dynamic roles by using the logic in the query, PeopleCode or directory rule to obtain a list of operator IDs. The role itself is assigned by the ROLESYNCHEXT_MSG service operation through internal messenging and integration broker.

You can see which dynamic roles are assigned to a user in the user profile page under the roles tab like any other role. You can also open the dynamic role and view dynamic members (users) of that role. Both areas allow you to test and execute the dynamic role rule. The test rule button returns users that will be given the dynamic role, however it does not assign the role. The execute rule actually assigns the dynamic role by running the DYNROLE_PUBL application engine program.

In addition to using a dynamic role to assign security through one or more permission lists, you may also want to use a dynamic role simply as a tag.

For example you might give students a dummy role of Alumni if they have completed a degree at your University. The logic to determine whether they have completed a degree could be in the form of a query or PeopleCode rule. As students are awarded degrees, they are automatically given the dynamic role. If for some reason, a degree is withdrawn, the role will automatically be removed.

PeopleCode could then simply check if a user has the dummy Alumni role and then show or hide appropriate functionality.

It is important to know that dynamic roles are added and removed automatically based on the results of the rule. You only need to write the rule to determine those operators that should get the role. PeopleSoft will add the role to those users that meet the rule criteria and remove it from those users that have the dynamic role but no longer meet the rule criteria. For example a student with an Alumni dynamic role, who has had their degree withdrawn would lose that role dynamically.

PeopleTools 8.50/8.51 AJAX issues(Intermittent "Error 501--Not implemented" Messages )


After immediately upgrading to PeopleTools 8.50, we have encountered several issues that were related to new AJAX features introduced in 8.50. Here is the list of such issues

1.  Getting frequent error 501 not implemented on the browser with IE7 and IE8.
2.  Component page reset. Users are getting kicked out to first page or the search dialog box in the middle of a multi page transaction and losing the data they have entered.
3.  Suddenly the page will become unresponsive and entire browser will freeze and will require restart of the browser.

All the 3 symptoms were annoying for the users and we eventually traced it to AJAX feature, that results in loss of POST data.

Temporary Solution:-

Turning off the AJAX setting resolved all 3 issues. Here is a way to turn off the AJAX

Go to PeopleTools –> Web Profile > Open the Web profile you use for e.g. DEV or PROD.


Go to Custom Properties and Add a Property AJAX of type Boolean and set its value to false. This will turn off the AJAX. To enable it again make it true or remove the row. Bounce all the Web servers using this web profile to make this setting take effect.


Permanent Solution:-

Though the above changes resolves the issue, this is not desirable and also may not be supported in future peopletools release. I have found this issue to be related to a bug in IE7 and IE8 when used with Windows XP OS. Fortunately microsoft includes the hotfix to resolve the issue, however registry change needs to be made to enable the hotfix. For more details, see this following KB http://support.microsoft.com/kb/895954 - When you use Microsoft Internet Explorer or another ! program to perform a re-POST operation, only the header data is posted.

 See How to enable this hotfix section for registry changes.

Basically, the issue happens as IE sends the AJAX request in 2 tcp ip packets one for the header and one for the body. When network error happens, and ie tries to send the ajax request again, it fails to send the body. This causes PIA to loose the session state and we see the issues described above. The other browsers Firefox, Safari and Chrome do not send ajax request in multiple packets and this issue does not appear there.

Also see this article on further clarification on which registry key needs to be modified : http://www.geoffchappell.com/viewer.htm?doc=notes/windows/ie/featurecontrol.htm

According to this , you can specify the value in any one of the following location, in order of decreasing precedence.
  • HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Internet Explorer\Main\FeatureControl
  • HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Main\FeatureControl
  • HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl
  • HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl


Display Prompt on a Search dialog box



If you have a prompt defined on a search record, it does not get displayed if you have component properties –> Internet tab set to use Basic Mode. (Default). Only Advanced mode displays the prompt on the search dialog box.


How to Default SYSDATE (Current Date) for PeopleTools Query Prompt Automatically

If you have a Query or Crystal Report, that has a date prompt and you want to schedule the report daily, so that date value is defaulted to sysdate (Current date), you can do this as follows.


  • Open the Query in PeopleTools Query tool.
  • Go to Criteria tab. 
  • Right Click on Expression2 Column and Select Expression or Expr-Expr if you are using between operator.


Type the following in Edit Expression.
Type
Default Date
Expression
Criteria
current date
decode(:1,TO_DATE('1900-01-01','YYYY-MM-DD'),trunc(sysdate),:1)

current date - 1
decode(:1,TO_DATE('1900-01-01','YYYY-MM-DD'),trunc(sysdate)-1,:1)

current date + 1
decode(:1,TO_DATE('1900-01-01','YYYY-MM-DD'),trunc(sysdate)+1,:1)

Replace :1 with the actual prompt value. You must first create this prompt.

Now you need to pass 01/01/1900 as an input parameter if you want to run the query for current date. Passing any other values will make the query run for that date.

This way you can achieve both i.e. run the query for a user selected date or run a query for current date which can be used to schedule. 

Note : You can use any date as a replacement for sysdate and not just 01/01/1900.

Also you can default it to any day relative to current date for e.g.trunc(sysdate) - 1 or trunc(sysdate) + 1 etc.

If you want to know what parameter user has passed in your report, you can add the following expression as field in your query.

Create an expression of type Date in left hand side Under Expressions.
Type
Default Date
Expression
Field
Current Date
decode(:1,'1900-01-01',to_char(trunc(sysdate),'YYYY-MM-DD') ,:1)

Current Date - 1
decode(:1,'1900-01-01',to_char((trunc(sysdate)-1),'YYYY-MM-DD') ,:1)

Current Date + 1
decode(:1,'1900-01-01',to_char((trunc(sysdate)+1),'YYYY-MM-DD') ,:1)

I have tested this on Oracle 9.2.0.8 and PeopleTools 8.48.12.

ORA-00022: invalid session ID; access denied

If you are getting this error, here is a quick fix.

Set the following value in psappsrv.cfg (appserver) and psprcs.cfg (batch server) for all the configured appservers and batch servers. You may have to reconfigure the appserver and batch servers and restart them.
DbFlags=8


Default value is DbFlags=0 which means use Persistent Secondary DB Connection.
Setting DbFlags=4 is not recommended by PeopleSoft, which completely disables the secondary database connection.
Setting it to 8 disables Persistent Secondary DB Connection, but it still uses on demand Secondary DB Connection for each request. This is required for using GetNextNumberWithGapsCommit (GNNWGC) function, which is internally used by PeopleSoft for workflow transactions to generate APPR_INSTANCE
If you do not do this, you may get row inserted in PS_APPR_INST_LOG with APPR_INSTANCE = which may cause, some undesired workflow routings.

The easiest solution I have found is
delete from ps_appr_inst_log where APPR_INSTANCE = 0


Please make sure that you backup the data and test it.

Monday, 21 July 2014

Synchronous App Message Error Status SQL


If you have turned on Logging in your Service Operations -> Routings, you can run these sql statements to get the Error details.

  • select * from psibloghdr where STATUSSTRING = 'ERROR' order by PUBLISHTIMESTAMP desc
  • select * from psiblogerr order by ERRORTIMESTAMP desc
  • select * from psiblogerrp order by ERRORTIMESTAMP desc

To see the explanation for message no., Run

  • select * from PSMSGCATDEFN where message_set_nbr = 158 and message_nbr = :1

You can see this information from online page


PeopleTools -> Integration Broker -> Service Operations Monitor -> Synchronous Services

Integration Gateway: General Connection Failed (158,10836)

We send a XML Message to Vertex using HTTPTargetConnector  in an app engine program in batch mode. Occasionally we see that the Return response is the following : Integration Gateway: General Connection Failed (158,10836)

On seeing some other resolution the following could be the cause of this message. 
This error is thrown when there is no valid response.
 


Possible errors include: 


  1. Bad gateway URL 
  2. Sync Service Timeout set and Service actually timed out. 
  3. Java exception thrown - Check Application Server for possible Java exception. 
Since URL is correct and there is no Java exception, I think the reason is Sync Service Timeout set and Service actually timed out.
For HTTPTargetConnector Properties there is a Header Property called Timeout for which the default value is 50 seconds. 
 
Specify the time in milliseconds for the connector to wait for the message to transmit. If the timeout period expires without a successful transmission, the transaction fails.
 
The default value is 50000 (50 seconds).

Setting the property value to 120000 (120 seconds or 2 minutes), resolved the issue. Make sure that you modify the Node Connector as well as routing connector properties if one is defined.


Navigation : PeopleTools –> Integration Broker –> Integration Setup –> Nodes –> Connectors
Property ID: HEADER
Property Name: TimeOut
Value: 120000

Go to Routings Tab and Select the Outbound Routing and Select Connector Properties. If you have a Property defined  for e.g. PRIMARYURL then you will need to add it here as well, otherwise if it is blank then it is not needed to be added here.

Insert into view which joins more than one table(INSERT,UPDATE or DELETE operation concept) and ORA-01776 (cannot modify more than one base table through a join view)


Updating a Join View

An updatable join view  is a view that contains more than one table in the top-level FROM clause of the SELECT statement, and is not restricted by the WITH READ ONLY clause.

The rules for updatable join views are shown in the following table. Views that meet these criteria are said to be inherently updatable.




Rule

General Rule

Any INSERT, UPDATE, or DELETE operation on a join view can modify only one underlying base table at a time.

UPDATE Rule

All updatable columns of a join view must map to columns of a key-preserved table. If the view is defined with the WITH CHECK OPTION clause, then all join columns and all columns of repeated tables are not updatable.

DELETE Rule

Rows from a join view can be deleted as long as there is exactly one key-preserved table in the join. The key preserved table can be repeated in the FROM clause. If the view is defined with the WITH CHECK OPTION clause and the key preserved table is repeated, then the rows cannot be deleted from the view.

INSERT Rule

An INSERT statement must not explicitly or implicitly refer to the columns of a non-key-preserved table. If the join view is defined with the WITH CHECK OPTION clause, INSERT statements are not permitted.

There are data dictionary views that indicate whether the columns in a join view are inherently updatable. 

DML Statements and Join Views

The general rule is that any UPDATE, DELETE, or INSERT statement on a join view can modify only one underlying base table. The following examples illustrate rules specific to UPDATE, DELETE, and INSERT statements.


Examples:

Examples illustrating the rules for inherently updatable join views, and a discussion of key-preserved tables, are presented in following sections. The examples in these sections work only if you explicitly define the primary and foreign keys in the tables, or define unique indexes.

 The following statements create the appropriately constrained table definitions for emp and dept.

CREATE TABLE dept (
      deptno        NUMBER(4) PRIMARY KEY,
      dname         VARCHAR2(14),
      loc           VARCHAR2(13));
CREATE TABLE emp (
      empno        NUMBER(4) PRIMARY KEY,
      ename        VARCHAR2(10),
      job          VARCHAR2(9),
      mgr          NUMBER(4),
      sal          NUMBER(7,2),
      comm         NUMBER(7,2),
      deptno       NUMBER(2),
      FOREIGN KEY (DEPTNO) REFERENCES DEPT(DEPTNO));


The following statement created the emp_dept join view which is referenced in the examples:

CREATE VIEW emp_dept AS

      SELECT emp.empno, emp.ename, emp.deptno, emp.sal, dept.dname, dept.loc

      FROM emp, dept

      WHERE emp.deptno = dept.deptno

         AND dept.loc IN ('DALLAS', 'NEW YORK', 'BOSTON');

INSERT Statements

The following INSERT statement on the emp_dept view succeeds:

INSERT INTO emp_dept (ename, empno, deptno)

   VALUES ('KURODA', 9010, 40);



This statement works because only one key-preserved base table is being modified (emp), and 40 is a valid deptno in the dept table (thus satisfying the FOREIGN KEY integrity constraint on the emp table).

An INSERT statement, such as the following, would fail for the same reason that such an UPDATE on the base emp table would fail: the FOREIGN KEY integrity constraint on the emp table is violated (because there is no deptno 77).

INSERT INTO emp_dept (ename, empno, deptno)

   VALUES ('KURODA', 9010, 77);



The following INSERT statement would fail with an error (ORA-01776 cannot modify more than one base table through a join view):

INSERT INTO emp_dept (empno, ename, loc)

   VALUES (9010, 'KURODA', 'BOSTON');