PeopleCode Not Authorized After Transfer

PeopleCode Not Authorized After Transfer

I was recently working on a PeopleSoft project where I had to call the Transfer Function [1] from PeopleCode. Since I had little experience with the Transfer Function, I mistakingly entered the information in a style similar to this:

Transfer(True, MenuName."MyMenuName", BarName."MyBarName", ItemName."MyComponentName", Page."MyPageName", "U"); 

If you are a veteran PeopleCode Programmer, you can probably immediately see the error in my logic. I specified the name of my component instead of the name of the item within the Menu Bar; unfortunately, PeopleCode did *not* give me a compile time warning or error when I did this.

Instead, when I ran my program and initiated the Transfer call, I got this ugly and not very helpful error message:

“You are not authorized to access this component. (40,20)

You have not been granted security authorization for the component you are attempting to access. You may have access to the designated component and page, but not in the specified action mode (such as Correction or Update/Display). Contact your system administrator.”

The error left me scratching my head for a bit of time. I was especially confused because I had *another* Transfer call of mine that *was* working. I began to wonder. Did security get setup correctly for the *component* I was trying to transfer to? Did I use the correct Action Mode (A, U, L, C, E) [1] in the transfer call?

Clueless, I began to ask my teammates for help while I continued to stew in my confusion. Per the error message, I tried changing the Action Mode to "L" - update/display all [1] even though the original "U - update" made more sense. Unfortunately, the change did not help me. I still got the cryptic error.

At some point, it became apparent to my team what I was doing wrong and they pointed out to me that I was entering the wrong parameters for my transfer call. The *most* significant error I had made was the one mentioned earlier where I had used the *component* name instead of the *Bar Item* name. After I corrected the parameters as my team had specified, the error gladly went away. 😎

An underlying lesson in this might be that if you happen to be using the PeopleCode Transfer function and get a "You are not authorized..." style error like the one above, you might want to check your BarName and ItemName parameters. An experienced PeopleCode Programmer might get that information correct the first time, but a new PeopleCode Programmer might goof up and be left with the rather unhelpful message mentioned above.


[1] - Unknown.
PeopleSoft Wiki. [Online] Unknown.
[Cited: January 1, 2015.]

©2015 - Shawn Eary
This post is copyright (where allowable) by Shawn Eary and is released under the Free Christian Media Licence (FCML). Content from authors other than Shawn Eary maintain the copyright and license rules that were imposed by the original authors.