Friday, August 26, 2011

GenerateComponentContentURL() Fail

We have a custom PeopleSoft module that handles requests from another web application. After authentication, this web application initially forwards the request to an iscript that, after identifying the user, redirects her to the appropriate home page. The redirect URL is created using the built-in PeopleCode function, GenerateComponentContentURL(). Here is an example:
%This.approverHomePage = GenerateComponentContentURL(%Portal, %Node, MenuName.MY_MENU, "GBL", Component.MY_HOME, "", "");
 ...
%Response.RedirectURL(&userIdentity.getHomePageURL());

This was working fine until the web application was updated. At that point, the redirect started to fail silently. After a lot of false starts, I determined that GenerateComponentContentURL was returning an empty string, but I could not figure out why.

Long story short, the newly-configured web application was using a URL for the iscript that had an invalid node. The url was:

https://myapp.com/psc/dbname/EMPLOYEE/PSFT/s/WEBLIB_CUSTOM.NAV_FUNCTIONS.FieldFormula.IScript_Navigation

but should have been:

https://myapp.com/psc/dbname/EMPLOYEE/PSFT_HR/s/WEBLIB_CUSTOM.NAV_FUNCTIONS.FieldFormula.IScript_Navigation

This caused %Node to return PSFT, an invalid node. One would think that GenerateComponentContentURL would throw an exception in this case, but it just returned an empty string. I also find it interesting that even with an invalid node in the URL, the iscript still ran.

Thus is life customizing PeopleSoft.

Thursday, August 11, 2011

Custom Buttons on Modal Pages

There are lots of good reasons to use modal pages and components in PeopleSoft. However, one thing you sacrifice is control, especially if you use the delivered Save and Cancel buttons that PeopleTools adds to your pages. There is nothing to stop you from adding your own buttons to the pages, but if you do the delivered buttons are still there, perhaps confusing the user. At least for the modal component, there is a solution. I tried disabling the toolbar in the component internet properties, but the buttons were still there.




Then a co-worker (thanks Giri) pointed out that if you actually uncheck the Save and Cancel checkboxes, the buttons are not shown. Wow. He's right. Problem solved. Is this a bug? Probably. Btw, we use PeopleTools 8.49.


Monday, August 8, 2011

Get Rid of Unwanted Save Warning

Have you ever had a component that gave you unwanted Save Warnings. I recently had to deal with this problem on a page that had a custom button that among many other things called doSaveNow() and then a transfer. Despite calling doSaveNow, the transfer resulted in a Save Warning. I traced the PeopleCode, but could not find any change between the save and transfer that should result in the warning. Frustrated, I searched online for a solution. I found an undocumented PeopleCode function designed for this situation - SetSaveWarningFilter( True).

Calling SetSaveWarningFilter with True input parameter causes the subsequent page to ignore the SaveWarning. It's not perfect because user is shown the page that would display the Save Warning, but then routed to the next page as if the user clicked the cancel button on the Save Warning dialog. In our situation this was good enough.