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

Inline editable related list that is pre-sorted by a field

What's the simplest way in Visualforce to show a related list that is sorted by a certain field? It should also be inline-editing enabled. Please post sample Visualforce and controller extension/ controller codes.
AnudeepAnudeep (Salesforce Developers) 
Hi Richard, 

The simplest way is to use the <apex:detail> component that has an attribute that activates inline editing, while the <apex:inlineEditSupport> component provides inline editing functionality to several container components. 
<apex:page standardController="Account">
   <apex:detail subject="{!account.ownerId}" relatedList="true" inlineEdit="true" title="false"/> 

However, I am unsure if it can do the ordering

You can use ORDER BY Clause in the SOQL to do the ordering

For showing a custom related list, please see this solution 

Let me know if this helps, if it does, please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Thanks Anudeep, I am trying to show in a VF page a related list of a custom object with editable rich text fields. This VF page will be displayed in a record detail page of a different custom object. Inline editing has to be enabled, and since it involved rich text fields, I can't use apex:enhancedList. I need something like apex:enhancedList but with inline edit enabled for rich text/ long text fields.
AnudeepAnudeep (Salesforce Developers) 
Hi Richard,

What you are looking for is not possible at the moment. There is an idea around this that I suggest taking a look