Dec 30, 2012

PeopleSoft : Check whether user belongs to a role:


IsUserInRole(rolename1 [, rolename2]. . .)

Returns a Boolean value: True if the current user belongs to one or more of the roles in the user role array, False otherwise.

Example:
    
     &flag=IsUserInRole("Admin");

PeopleSoft : Passing values while transfer to another page:


&queryString = "&SOURCE=R";
            /* generate a url */
            &url = GenerateComponentRelativeURL(%Portal, %Node, MENUNAME.MenuName, MARKET.marketname,COMPONENT.componentname,PAGE.pagename,action);
           
            /* Append parameters */
            &url = &url | &queryString;
           
            ViewURL(&url, False);
Syntax:
  1. 1      GenerateComponentRelativeURL(PORTAL.portalname, NODE.nodename, MENUNAME.menuname, MARKET.marketname, COMPONENT.componentname, PAGE.pagename, action, [, keylist])
  2.    ViewURL(URL_str | URL.URL_ID [, NewWindow])
  3.    ViewContentURL(URL_str | URL.URL_ID)


Use the ViewContentURL function to launch a new browser window

Use the ViewURL function to launch the default browser

exmple:

&queryString = "&SOURCE=R";
&url=GenerateComponentRelativeURL(%Portal, %Node, MENUNAME.CH_MENU,"GBL",COMPONENT.CH_COMPONENT,PAGE.CH_PAGE,"U");
 &url = &url | &queryString;
           
 ViewURL(&url, False);

PeopleSoft : Check whether user belongs to a role through peoplecode:


IsUserInRole(rolename1 [, rolename2]. . .)

IsUserInRole() function is used to check whether current user has  the role in his profile or not.

This function returns  a Boolean value:
                                       True if the current user belongs to one or more of the roles in the user role array,
                                        False otherwise.


Example:
 local boolean &hasRole;
 &hasRole= IsUserInRole(CH_ROLE_EMPLOYEE);



&hasRole contains true if the currnet user has CH_ROLE_EMPLOYEE in his profile.