AnsweredAssumed Answered

get secondary institution role

Question asked by mohamed95 on Nov 14, 2018
Latest reply on Nov 20, 2018 by mohamed95

Hello, every one I am trying to get secondary institution role, for the currently logged in user.

I tried this code buy it is not working it is giving a null pointer exception

    <body>

        <bbData:context id="ctx">

            <div>

        <h1>Hello World!</h1>

        <%

try {

    User usr = ctx.getUser();

    out.println("email"+usr.getEmailAddress()+"<br>");

    out.println("batchid"+usr.getBatchUid()+"<br>");

    out.println("DataSourceId().getExternalString()"+usr.getDataSourceId().getExternalString()+"<br>");

    out.println("getPortalRole().getDescription"+usr.getPortalRole().getDescription()+"<br>");

    out.println("getPortalRole().getPersistentLabel()"+usr.getPortalRole().getPersistentLabel()+"<br>");

    out.println("usr.getPortalRole().getRoleID()"+usr.getPortalRoleId().getExternalString()+"<br>");

    out.println("usr.getPortalRole().getRoleID()"+usr.getPortalRole().toString()+"<br>");

    out.println("usr.getPortalRole().getRoleName()"+usr.getPortalRole().getRoleName()+"<br>");

    out.println("usr.getPortalRole().toString()"+usr.getPortalRole().toString()+"<br>");

} catch (Exception ex) {

    out.println(ex.toString());

}       %>

    </div>

</bbData:context>

 

anything related to getPortalRole() gives a null pointer exception.

working on learn instance.

kind regards.

Outcomes