You need to sign in to do that
Don't have an account?
Adriana Voyce
Make Visualforce display related list only and not clickable
Hi All,
I created a visualforce page to display a related list from a custom object. It looks great and I was able to remove the edit links as well. I would like however for the list to be read only though. I want the page to show the columns and details but I do not want the user to be able to click on the record reference to try to navigate to it. If they click on the VF page I do not want anything to happen.
Here is my code for the page. I tried readOnly="True" but it does not seem to work.
<apex:page standardController="SBQQ__Quote__c" readOnly="true"> <apex:relatedList list="SBQQ__LineItems__r" /> <style> [Class*='actionColumn'] { display:none; visibility:hidden; } </style> <style> [Class*='linkSpan'] { display:none; visibility:hidden; } </style> </apex:page>
Any suggestions?
I created a visualforce page to display a related list from a custom object. It looks great and I was able to remove the edit links as well. I would like however for the list to be read only though. I want the page to show the columns and details but I do not want the user to be able to click on the record reference to try to navigate to it. If they click on the VF page I do not want anything to happen.
Here is my code for the page. I tried readOnly="True" but it does not seem to work.
<apex:page standardController="SBQQ__Quote__c" readOnly="true"> <apex:relatedList list="SBQQ__LineItems__r" /> <style> [Class*='actionColumn'] { display:none; visibility:hidden; } </style> <style> [Class*='linkSpan'] { display:none; visibility:hidden; } </style> </apex:page>
Any suggestions?
Use following code.
Let us know if it helps you.
Regards,
Yogesh More
Salesforce consultant || Salesforce Developer
more.yogesh422@gmail.com || www.yogeshmore.com
Skype:-yogesh.more44
All Answers
Hi Adriana ,
Best option is to use javascript and remove links from the related list.
As I don't know what apex:relatedList will form your html markup in your web page in your org , as I don't have access to your org
You need to inspect element ifor the output page to findout what is your markup html forming for apex:relatedlist for javascript
Another option you can use is css to disable links using css , it will disable navigation but it will show as links
a{
pointer-events: none;
cursor: default;
}
Hope this helps
If you don't want to use javascript and css for this , then you can also use apex:pageblockTable to show your data.
You need to just replace apex:relatedlist tag to apex:pageBlockTable
Below is just a small example :)
<apex:pageblockTable value="{!SBQQ__LineItems__r}" var="lineitemObj">
<apex:column name="{!lineitemObj.Name}">
</apex:pageBlockTable>
https://help.salesforce.com/apex/HTViewSolution?urlname=Customizing-related-Lists-Using-VisualForce-and-Apex-1327107624263&language=en_US
Use following code.
Let us know if it helps you.
Regards,
Yogesh More
Salesforce consultant || Salesforce Developer
more.yogesh422@gmail.com || www.yogeshmore.com
Skype:-yogesh.more44
The answer YogRaj worked great, however, the reason why I wanted the visualforce page of the related list is because I want to remove the visualforce page from the layout. When I did that, the columns from the VF page disappered and reset to show only the record name :( any ideas on how I can have it shows the columns from the related list without the list its self being on the layout?