You need to sign in to do that
Don't have an account?
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:
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!
Hi
Make sure that is it Lead.Owner OR Lead.OwnerId
All Answers
Hi
Make sure that is it Lead.Owner OR Lead.OwnerId
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!