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
Alex Valavanis 10Alex Valavanis 10 

Mass update formula records on Account object

Hello,

I recently created a visual force page on the Account object (And a custom button) which basically helps the user to update mass Accounts form a list view. Solution works great, however if I add a formula type field (text or number) to the page this cannot be updated by the user (screenshot provided). Is this because it is a formula field? Is there a way which we can solution this?

User-added image
Visual Force code shoud you require is:

<apex:page standardController="Account" recordSetVar="accounts" tabStyle="Account" sidebar="false" lightningStylesheets="true"> <apex:form > <apex:pageBlock title="Edit Accounts" mode="edit"> <apex:pageMessages /> <apex:pageblockButtons location="top"> <apex:commandButton value="Save" action="{!Save}" /> <apex:commandButton value="Cancel" action="{!cancel}"/> </apex:pageBlockButtons> <apex:pageBlockTable value="{!selected}" var="A"> <apex:column headerValue="Name"> <apex:outputField value="{!A.name}"/> </apex:column> <apex:column headerValue="Owner"> <apex:inputField value="{!A.OwnerId}"/> </apex:column> <apex:column headerValue="Record Type"> <apex:inputField value="{!A.RecordtypeId}"/> </apex:column> <apex:column headerValue="Client Type"> <apex:inputField value="{!A.Client_Type__c}"/> </apex:column> <apex:column headerValue="Country"> <apex:inputField value="{!A.Country__c}"/> </apex:column> <apex:column headerValue="Client Status"> <apex:inputField value="{!A.Client_Status__c}"/> </apex:column> <apex:column headerValue="First Funded"> <apex:inputField value="{!A.First_Funded__c}"/> </apex:column> <apex:column headerValue="Industry"> <apex:inputField value="{!A.Industry}"/> </apex:column> <apex:column headerValue="Last Contact"> <apex:inputField value="{!A.Last_Contact__c}"/> </apex:column> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:page>
SwethaSwetha (Salesforce Developers) 
HI Alex,
Forumla fields are read-only fields that derive their value from a formula expression you define. The formula field is updated when any of the source fields change automatically.

So it is expected behaviour for them to be not editable in list view.

See documentation: https://help.salesforce.com/articleView?id=customize_formulas.htm&type=5

​​​​​​​Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you