Sometimes you would want to give users the option to click a button on the page and send them back to the Portal Folder they came from, or may be couple folders back! Here is how you go about doing that.
You can actually use the PeopleSoft delivered function NavPageURL to accomplish this! So, lets get started!
On your page, go ahead and add a button. Place the following PeopleCode at the Component Record Field level under FieldChange event
&LINKURL = NavPageURL(%Portal, %Node, "your-folder-object-name", "PSC", "", "", "False", "", "", "");
%Response.RedirectURL(&LINKURL);
And here is the code for the NavPageURL function:
If All(&PortalName, &NodeName, &ObjName) Then
Evaluate Upper(&URLType) When = "PSC" &URL = GenerateScriptContentURL(&PortalName, &NodeName, Record.WEBLIB_EOPP_SC, Field.HOMEPAGE, "FieldFormula", "IScript_AppHP"); Break; When = "PSP" &URL = GenerateScriptPortalURL(&PortalName, &NodeName, Record.WEBLIB_EOPP_SC, Field.HOMEPAGE, "FieldFormula", "IScript_AppHP"); Break; When-Other &URL = GenerateScriptContentURL(&PortalName, &NodeName, Record.WEBLIB_EOPP_SC, Field.HOMEPAGE, "FieldFormula", "IScript_AppHP");
End-Evaluate;
&URL = &URL | "?scname=" | &ObjName;
If All(&SecValue) Then &URL = &URL | "&secondary=" | &SecValue; End-If;
If All(&FolderName) Then &URL = &URL | "&fname=" | &FolderName; End-If;
If All(&PTcname) Then /* pass either CFAN Cref or DFAN Fref, not both */ &URL = &URL | "&PORTALPARAM_PTCNAV=" | &PTcname; Else If All(&PTfname) Then &URL = &URL | "&pt_fname=" | &PTfname; End-If; End-If;
If All(&TargPortalName) Then &URL = &URL | "&targetportal=" | &TargPortalName; End-If;
If Upper(&VirtualValue) = "TRUE" Then &URL = &URL | "&isvirtual=" | &VirtualValue; End-If;
End-If;
Return &URL;
End-Function;