PeopleSoft Generated URLs Go To the Wrong Instance

Story time. I built a process that would load people. If there was an error loading a person, it would send an email. Because I would have no way of knowing what might have been written to the log (SSN, birthday, etc.), I decided to just include a link to the screen where a user could review and fix the error. Everything worked great.

The problem was that in certain environments, that URL went to production. It should have gone to the test environment where we were validating the new development.

What was the fix? Here are my notes…

Generating the URL

First, let me walk you through what I used to generate the links.

Here is the code that I have for generating the URL:

Local string &url = GenerateComponentPortalURL(%Portal, %Node, MenuName.MY_MENU, "GBL", Component.MY_COMPONENT, Page.MY_PAGE, "U");

Method: GenerateComponentPortalURL()

Here are the parameters.

  • Portal — Just use %Portal for the portal where your code is current running
  • Node — Just use %Node for the current node
  • Menu — the menu where your component is registered
  • Market — the market of your component (normally GBL)
  • Component — the component name you want to point to
  • Page — the page in the component
  • Action/Mode — U for update; C for correct history; A for Add

Now, %Portal and %Node work great when you are running your code online in the PIA. But, it’s a different story in an App Engine running on the Process Scheduler. In that case, you technically aren’t in a portal. Therefore, %portal will generate an error. Instead, you can select the portal from the target content reference and you can get the default node from the database.

Local string &portalName, &nodeName;
SQLExec("SELECT MSGNODENAME FROM PSMSGNODEDEFN WHERE LOCALDEFAULTFLG = 'Y'", &nodeName);
SQLExec("SELECT PORTAL_NAME FROM PSPRSMDEFN WHERE PORTAL_URI_SEG1 = :1 AND PORTAL_URI_SEG2 = 'MY_COMPONENT' AND PORTAL_CREF_USGT = 'TARG'", &menuName, &portalName);

Fixing the URL

So, what happens when the URL it generates is wrong? You need to fix the setting on the Portal Node.

First, search for your local node. Go to Integration Broker > Integration Setup > Node Definitions. You can limit it to Node Type of PeopleSoft if you want to reduce your list a little.

Locate the row where the default local node is “Y”. This is the one that you want to edit or check. For me, that’s PSFT_HR. If you are in Campus, it will probably be the SA node.

For that node, go to the Portal tab. You will want to check the Content URI Text and the Portal URI text. These URLs have to be correct.

The URL has to match the URL that you are using to access your PeopleSoft instance. I have “ps” for the site, but many people have the instance name such dev, tst, etc. The problem I was seeing was that after a refresh, this wasn’t updated, and this URL was still pointing to production.

One thought on “PeopleSoft Generated URLs Go To the Wrong Instance

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.