• Bryan Macoy
  • 0 Points
  • Member since 2021

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 2
I create a List View button that updated selected records. Here is my code:

** Visual Force Page **

<apex:page standardController="custom_Object" extensions="custom_Object_Controller" recordSetVar="givenRecords" lightningStylesheets="true">

    <!--- Display message if no records have been selected -->
    <apex:form id="noRecords"  rendered="{!isRecordSelected ==false}" style="font-size:14px;font-weight:bold;" >
        <apex:pageMessages ></apex:pageMessages>
        <apex:commandButton action="{!Cancel}" value="Back" style="margin-left:200px;"/>  
    <!-- Display Selected Records -->
    <apex:form id="withRecords"  rendered="{!isRecordSelected ==true}" style="font-size:14px;font-weight:bold;" >

                        <th>Company Name<hr></hr></th>
                        <th>Contact Name<hr></hr></th>
                    <apex:repeat value="{!givenRecords}" var="record">
                                <apex:inputField value="{!record.CompanyName__c}"/>
                                <apex:inputField value="{!record.ContactName__c}"/>
          <apex:commandButton action="{!Cancel}" value="Back" style="margin-left:200px;"/>     
            <apex:commandButton value="Save" action="{!save}"/>
** Controller **

public without sharing class custom_Object_Controller {

    public List<custom_Object_Controller> givenRecords{get;private set;}
    public Boolean isRecordSelected {get;set;}
    // Constructor
    public custom_Object_Controller(ApexPages.StandardSetController stdSetController){
        // Returns all selected records
        givenRecords= (List<custom_Object_Controller>) stdSetController.getSelected();
            isRecordSelected = false;
            ApexPages.addMessage(new ApexPages.message(ApexPages.severity.WARNING,'No records have been selected.'));
            isRecordSelected = true;
    public PageReference save(){
         update givenRecords;
        } catch(Exception e){
            System.debug('Exception: ' + e);
        return null;

How can I have it pop up in a dialog box instead of opening to a new vfp window?

How to bulk upload a images in rich text field.

I have one custom object called Object_A__c and i have created a new rich text field it's called Rich__c. I have 1000 images i want to upload those images ito salesforce  (Images should be map in a  Rich__c field )

I created a CSV file / Make 2 colums / 1 for Name another one for Image.