+ Start a Discussion
Alex Valavanis 10Alex Valavanis 10 

how to mass edit records in a custom object

Hello, 
I want to create a way of mass uploadin fields on custom object "task". I installed mass edit/update but the instructions for custom objects are very old and they have not updated them. Anyway...
Is there a way of doing this (have no visual force / apex experience) - please see my screenshots

User-added image

User-added image
Best Answer chosen by Alex Valavanis 10
Ajay K DubediAjay K Dubedi
Hi Alex,
Please try this code it's easy and simple for new salesforce developer.
click on any field which you want to edit then save.
This is mass inlineEdit Visualforce Page.

<apex:page standardController="TaskTest__c" recordSetVar="records">  
    <apex:form >
        <apex:pageBlock title="Task Summary" mode="inlineEdit">      
            <apex:pageBlockTable value="{! records}" var="rec">   
                <apex:column headerValue="Name" >
                    <apex:outputField value="{! rec.Name}" />
                </apex:column>
                <apex:column headerValue="Discription " >
                    <apex:outputField value="{! rec.Discription__c}" />
                </apex:column>
                <apex:column headerValue="Estimated Date for Task" >
                    <apex:outputField value="{! rec.Estimated_Date_for_Task__c}" />
                </apex:column>
                <apex:column headerValue="Owner" >
                    <apex:outputField value="{! rec.Owner__c}" />
                </apex:column>
                <apex:column headerValue="Status " >
                    <apex:outputField value="{! rec.Status__c}" />
                </apex:column>
                <apex:column headerValue="User Story " >
                    <apex:outputField value="{! rec.User_Story__c}" />
                </apex:column>
                <apex:inlineEditSupport showOnEdit="saveButton, cancelButton" 
                                        hideOnEdit="editButton" event="ondblclick" 
                                        changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>
            </apex:pageBlockTable>
            <apex:pageBlockButtons>
                <apex:commandButton action="{!quicksave}" id="saveButton" value="Save" rendered="true"/>
                <apex:commandButton onclick="resetInlineEdit()" id="cancelButton" value="Cancel" rendered="true"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Please mark it as best Answer if you find it helpful.

Thank You
Ajay Dubedi

All Answers

Ajay K DubediAjay K Dubedi
Hi Alex,
Please try this code it's easy and simple for new salesforce developer.
click on any field which you want to edit then save.
This is mass inlineEdit Visualforce Page.

<apex:page standardController="TaskTest__c" recordSetVar="records">  
    <apex:form >
        <apex:pageBlock title="Task Summary" mode="inlineEdit">      
            <apex:pageBlockTable value="{! records}" var="rec">   
                <apex:column headerValue="Name" >
                    <apex:outputField value="{! rec.Name}" />
                </apex:column>
                <apex:column headerValue="Discription " >
                    <apex:outputField value="{! rec.Discription__c}" />
                </apex:column>
                <apex:column headerValue="Estimated Date for Task" >
                    <apex:outputField value="{! rec.Estimated_Date_for_Task__c}" />
                </apex:column>
                <apex:column headerValue="Owner" >
                    <apex:outputField value="{! rec.Owner__c}" />
                </apex:column>
                <apex:column headerValue="Status " >
                    <apex:outputField value="{! rec.Status__c}" />
                </apex:column>
                <apex:column headerValue="User Story " >
                    <apex:outputField value="{! rec.User_Story__c}" />
                </apex:column>
                <apex:inlineEditSupport showOnEdit="saveButton, cancelButton" 
                                        hideOnEdit="editButton" event="ondblclick" 
                                        changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>
            </apex:pageBlockTable>
            <apex:pageBlockButtons>
                <apex:commandButton action="{!quicksave}" id="saveButton" value="Save" rendered="true"/>
                <apex:commandButton onclick="resetInlineEdit()" id="cancelButton" value="Cancel" rendered="true"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Please mark it as best Answer if you find it helpful.

Thank You
Ajay Dubedi
This was selected as the best answer
Alex Valavanis 10Alex Valavanis 10
Hi Ajay, Thank you, i will but where do i add this code? Custome object Task? Do i go to "Search layouts"? 

Also i noticed <apex:page standardController="TaskTest__c" recordSetVar="records">  

I don't have a TaskTest__c i don't think.

 
Alex Valavanis 10Alex Valavanis 10
Also Ajay - Do i have to create a custom button as well?

Any advice appreciated. Thank you
Ajay K DubediAjay K Dubedi
Hi Alex, 

1. First, go to developer console and create new VF page then paste this code there.
2.<apex:page standardController="TaskTest__c" recordSetVar="records"> put your custom object name as TaskTest__c.
3.<apex:page standardController="task__c" recordSetVar="records"> just like this.
4. You don't need to create any custom button.
5. Also, you can check API name of fields of your custom object. The API name may vary from API name of fields I use in my code.

Let me know if any problem occurs again. If you find my solution beneficial then mark it as the best answer.

Thank You
Ajay Dubedi
Narender Singh(Nads)Narender Singh(Nads)
Hi Alex,
Have you tried this?
http://dazeworks.com/appyninja/mass-update-edits-delete/

This is exactly what  you are asking for.

Let me know if it helps.
Alex Valavanis 10Alex Valavanis 10
Hi Ajay, So far so good. There are no issues with code so thank you.
What happens after that?
Because when i go to object "TASKS" i can NOT mass edit, so what i did is created a custom button "Mass Edit" (see below).

When i click on Mass Edit though, only 20 records appear. :( Please advice

User-added image
 
Alex Valavanis 10Alex Valavanis 10
Also when i click on the custom button i created "Mass Edit", the page shows me the TASK SUMMARY.
Ajay K DubediAjay K Dubedi
Hi Alex,

If you get more than 20 records you need to create a custom controller and add your VF page. You can also use the custom button.
I will recommend you to start using trailhead to learn about Custom controller.

Please check URL below:

https://trailhead.salesforce.com/en/modules/visualforce_fundamentals/units/visualforce_custom_controllers

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_controller.htm

Thank You
Ajay Dubedi
Alex Valavanis 10Alex Valavanis 10
Hi Ajay, Thank you for everything. So when i click on the custom button does it come in 20s?
(Could you give me your email please?)

What happens if i want to create an "update" VF for the same object? Could you please tell me how the code will change?