function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Devendra SawantDevendra Sawant 

User role Error

 

Hi,

I have created one vf page where i have listed all the roles from the org.

When i click on particular role to view detail page, i get the following error message,

"An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience. "

May i know why this error is coming and how to resolve this issue?

Cheers,
Devendra S




tedwardtedward

Are you able to post the code for the page and also an example of a url that is causing the error.

Devendra SawantDevendra Sawant

 

Hi,

 

In the first page, I am listing all available roles,

 

<apex:pageBlock >
  <apex:pageBlockTable value="{!list_role}" var="role" title="Roles" id="usertable">
  
<apex:column headerValue="Roles">
    <apex:outputLink value="/apex/RoleDetailPage?id={!role.Id}" tabindex="tab1">{!role.Name}</apex:outputLink>
 </apex:column>
</apex:pageBlock>



Controller to list all available roles,

 

public class RoleList {
   
    public List<UserRole> list_role{get;set;}
    public RoleList(ApexPages.StandardController controller) {
   
    list_role=[Select Name From UserRole];
   
    }

}

 

When i click on particualar Role it should display detail of that Role.

 

I have one more VF page to display detail of indivisual role,

 

<apex:page standardController="UserRole" tabStyle="Admin__c">
    <apex:detail title="false" relatedList="false"/>
</apex:page>

 

URL which is causing an error: https://c.na7.visual.force.com/apex/RoleDetailPage?id=00EA0000000u9pvMAA

 

I get this error message : An internal server error has occurred

 

How to resolve this issue?

 

Cheers,

Devendra S

tedwardtedward

The role detail page is not a "normal" object detail page so it doesn't surprise me that you can't use the <apex:detail> component - However this response from Salesforce obviously isn't very user friendly.

 

You can access the standard fields from the UserRole object using the standard controller but I'm not sure this will give you the information you require.

 

You can display the role detail page without the sidebar and header if you wanted to embed the page (by using the isdtp=mn url parameter) but this unfortunately doesn't use the standard style theme.

 

 

Devendra SawantDevendra Sawant

Hi,

 

It means we can not able to use standard Role functionality in customize way.

 

I have list of records. I want to assign each record to particular Role(It can be to multiple roles also).

 

For that, i wanted to display Role list on a visualforce page.

 

Will it be posible to do this??

tedwardtedward

You can easily display the role name on the page using the standard controller.   If you want more detailed information, for example the name of the parent role, then you will need to write a custom controller to get the information you want.   The error is caused when trying to use the <apex:detail> visual force component when using the UserRole standard controller.

 

<apex:page standardController="UserRole">
  <apex:pageBlock >
    <apex:pageBlocksection title="Role Detail">
      <apex:outputField value="{!UserRole.Name}"/>
    </apex:pageBlocksection>
  </apex:pageBlock>
</apex:page>