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
debikendebiken 

Customized Lead page in VF and ownerID behavior

This is probably a simple one...I have a custom VF page for leads that is launched from a custom lead summary page.  I want the ownerID field to display with the users info in read only mode when creating the lead.  Instead I'm getting a drop list box for "User" or "Queue" and a lookup field for the users name.  It seems as if the page doesn't realize it's a "create a new record" type of action.  I'm displaying the lead data summary on a page with this button to launch the custom page:

<apex:outputLink styleClass="btn" value="{!$Page.riceLeads}"> New Rice Lead</apex:outputLink>

 

Do I need to add something to indicate to the custom page that this is a new lead?

Pradeep_NavatarPradeep_Navatar

Are you using standard controller or custom controller?



jmarie1228jmarie1228

Sorry for the lack of information...I am using the standard lead object with no extension.  thanks for your repoy

jkucerajkucera

If you use outputText, does that grab the user info you're looking for? 

 

You may need to do a bit more coding to grab the userID info and create the link in the controller and then expose that back to outputLink.

debikendebiken

Thanks John - a little more info...we have 2 different lead types that mutliple users need to see and the content is different based on the lead type.  Since we could not assign more than one page layout per user, I created a VF Page that essentially is the lead object with the extra fields visible.  So from the "lead summary" tab page, I have these buttons:

<apex:pageBlockButtons >
          <apex:outputLink styleClass="btn" value="{!$Page.riceLeads}"> New Rice Lead</apex:outputLink>
          <apex:outputLink styleClass="btn" value="{!URLFOR($Action.Lead.New)}">New Lead</apex:outputLink>
</apex:pageBlockButtons>

 

When the user clicks the second link button the "standard" lead form comes up with the user info in the Lead owner fields.  This is because of the 'Action.Lead.New' .  Is there a better way to open the other page indicating to the page that it is a new record?

 

This is the page element from the "custom" page....everything else on the page is just standard content (input boxes, buttons, related lists)

<apex:page StandardController="Lead" title="Rice Lead" showHeader="true" tabStyle="lead" >

 

Thanks in advance for your help, I feel like this is just a syntax issue..(?)

jkucerajkucera

Are you saying the problem is that you can't get the User Id in the Rice page when that button is clicked?  You could pass the user Id in the URL if that's the problem.