You need to sign in to do that
Don't have an account?
Override standard page & auto assigning UserID to OwnerID
I'm in the process of overriding our "new" button functionality for when our users create a new lead. One of the things that I lost (I think) as I was doing this was having the User ID automatically assigned to the Owner ID. I'd like to also allow the user to change this (e.g. they're creating a lead, but need to assign it to someone else) as this situation happens at times.
I've done some Google searching to figure out if I can set the value for a field, but I haven't been able to find any examples (poor Google skills, I'm thinking).
Could anyone help me with this?
This is what I have so far for my page:
<apex:page standardController="Lead" tabStyle="Lead" showHeader="true" sidebar="true"> <apex:form> <apex:sectionHeader title="Lead Edit" subtitle="{!if(Lead.Id==null,'New Lead',Lead.Name)}"> <apex:pageBlock mode="maindetail" id="myLeadInstructions" title="Lead Instructions"> I'll put my Lead Rules information here in standard HTML. </apex:pageBlock> <apex:pageBlock mode="edit" id="leadEditBlock" title="Lead Edit"> <apex:pageBlockButtons> <apex:commandButton action="{!save}" value="Save"></apex:commandButton> <apex:commandButton action="{!cancel}" value="Cancel"></apex:commandButton> </apex:pageBlockButtons> <apex:pageMessages></apex:pageMessages> <apex:pageBlockSection id="leadInfoBlock" title="Lead Information"> <apex:inputField value="{!Lead.OwnerID}"></apex:inputField> <apex:inputField value="{!Lead.Phone}"></apex:inputField> <apex:pageBlockSectionItem> <apex:outputLabel value="{!$ObjectType.Lead.Fields.FirstName.label}"></apex:outputLabel> <apex:outputPanel> <apex:inputField value="{!Lead.Salutation}"></apex:inputField> <apex:inputField value="{!Lead.FirstName}"></apex:inputField> </apex:outputPanel> </apex:pageBlockSectionItem> <apex:inputField value="{!Lead.MobilePhone}"></apex:inputField> <apex:inputField value="{!Lead.LastName}"></apex:inputField> <apex:inputField value="{!Lead.Company}"></apex:inputField> <apex:inputField value="{!Lead.Email}"></apex:inputField> <apex:inputField value="{!Lead.Title}"></apex:inputField> <apex:inputField value="{!Lead.Website}"></apex:inputField> <apex:inputField value="{!Lead.Leadsource}"></apex:inputField> <apex:inputField value="{!Lead.Status}"></apex:inputField> <apex:inputField value="{!Lead.Industry}"></apex:inputField> <apex:inputField value="{!Lead.NumberOfEmployees}"></apex:inputField> </apex:pageBlockSection> </apex:pageBlock> </apex:sectionHeader> </apex:form> </apex:page>
Thanks for your help!
Thanks for you help. I actually ended up writing an extension controller for my Lead controller with the following:
And this did the trick for me. Thanks for the help though!
All Answers
When a lead is created, user will be allowed to change the Owner of the lead.
is it your requirement?
While creating lead you can assign to other user, a lookup filed is there Lead Owner .
Also after saving there is a link change already present (By salesforce), click on that to change the owner of lead
Can you please try this and let me know if it works for you or not
Thanks for you help. I actually ended up writing an extension controller for my Lead controller with the following:
And this did the trick for me. Thanks for the help though!