• Nathan Taber
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi,

 

I have a custom button, Close Lead, that redirects the user to a visualforce page.

 

This is the URL of the visualforce page:

 

https://c.cs8.visual.force.com/apex/CloseLeadReason?Status=Lead%20Closed&id=00QL0000001wv7v

 

And this is the visualforce page. very simple, just showing to fields, lead status and lead status result:

 

<apex:page standardController="Lead" showHeader="true">
    <apex:sectionHeader title="Lead Edit" subtitle="{!Lead.Company}"/>  
    <apex:form >
        <apex:pageBlock title="Lead Edit" id="Edit_Fiscal_Information" mode="Edit">
            <apex:pageMessages />
            <apex:pageBlockButtons >
                <apex:commandButton value="Close" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:PageBlockButtons>
            <apex:pageBlockSection columns="2">
                <apex:pageBlockSectionItem >
                        <apex:outputLabel value="Lead Status"/>
                        <apex:inputField value="{!lead.Status}"/>
                    </apex:pageBlockSectionItem>
                 <apex:pageBlockSectionItem >
                        <apex:outputLabel value="Lead Status Result"/>
                        <apex:inputField value="{!lead.Lead_Status_Result__c}"/>
                 </apex:pageBlockSectionItem>
            </apex:pageblockSection>
       </apex:pageBlock>
     </apex:form>
</apex:page>

 

I want to prepopulate the field status with the value of the picklist 'Lead Closed' using the URL, but I am not able to do so.

 

Can anyone show me how to get it?

 

Thanks a lot!

 

Antonio