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
JcaliJcali 

Mass Change Owner PE

Hello,

 

Have salesforce professional edition. We have recently been attempting to create a apex/visualforce code that will allow non-admin users to be able to mass transfer leads to others.

 

We previously created a apex/visualforce code that allows this function for mass changing lead status. Here is the lead status change code:

 

 

<apex:page standardController="Lead" recordSetVar="allLeads">
    <apex:form >
        <apex:sectionHeader title="Change status for Leads"/>
        <apex:pageBlock mode="edit">
            <apex:pageMessages />
            <apex:pageblockSection title="Change">
                <apex:inputField value="{!Lead.Status}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Selected Leads">
                <apex:pageBlockTable value="{!selected}" var="l">
                    <apex:column value="{!l.Name}"></apex:column>
                    <apex:column value="{!l.Email}"></apex:column>
                    <apex:column value="{!l.Status}"></apex:column>
                </apex:pageBlockTable>
            </apex:pageblockSection>
            <apex:pageBlockSection title="All Leads">
                <apex:pageblocktable value="{!allLeads}" var="AL" id="leadTable">
                    <apex:column value="{!AL.Name}"></apex:column>
                    <apex:column value="{!AL.Email}"></apex:column>
                    <apex:column value="{!AL.Status}"></apex:column>
                </apex:pageblocktable>
            </apex:pageBlockSection>
            <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>
		

 

 

The above code works great for allowing non-admin users to mass change lead status'. Now we attempted to modify the code to allow the same function however now be able to mass change the Lead Owner field with the following code:

 

 

<apex:page standardController="Lead" recordSetVar="allLeads">
    <apex:form >
        <apex:sectionHeader title="Change OWNER for Leads"/>
        <apex:pageBlock mode="edit">
            <apex:pageMessages />
            <apex:pageblockSection title="Change">
                <apex:inputField value="{!Lead.Owner}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Selected Leads">
                <apex:pageBlockTable value="{!selected}" var="l">
                    <apex:column value="{!l.Name}"></apex:column>
                    <apex:column value="{!l.Email}"></apex:column>
                    <apex:column value="{!l.Status}"></apex:column>
                </apex:pageBlockTable>
            </apex:pageblockSection>
            <apex:pageBlockSection title="All Leads">
                <apex:pageblocktable value="{!allLeads}" var="AL" id="leadTable">
                    <apex:column value="{!AL.Name}"></apex:column>
                    <apex:column value="{!AL.Email}"></apex:column>
                    <apex:column value="{!AL.Status}"></apex:column>
                </apex:pageblocktable>
            </apex:pageBlockSection>
            <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

The code seems to validate ok when saving it as a visual force page, however when we run it in the lead view the following error occurs:

 

ERROR
  Error:j_id0:j_id1:j_id3:j_id31:j_id32: An error occurred when processing your submitted information.


  = Required Information Change
Lead Owner
UserQueue
Error: j_id0:j_id1:j_id3:j_id31:j_id32: An error occurred when processing your submitted information.

 

This is after selecting "Save".

 

Does anyone know whats wrong with the code? or could anyone please help us in finding a method for users in Professional edition to be able to Mass change lead status as a non-admin user?

 

Thanks!

Best Answer chosen by Admin (Salesforce Developers) 
Virendra NarukaVirendra Naruka

Hi

Make sure that is it  Lead.Owner OR Lead.OwnerId

Lead.Owner or Lead.OwnerId

All Answers

Virendra NarukaVirendra Naruka

Hi

Make sure that is it  Lead.Owner OR Lead.OwnerId

Lead.Owner or Lead.OwnerId
This was selected as the best answer
JcaliJcali

Thanks for your quick reply. I had Lead.Owner and Lead.OwnerId fixed the problem!

 

Thanks for your help. Our ORG users are very happy now!