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
AB12AB12 

Custom Button Help

Hi All,

 

I am trying to create a custom button on the Lead object where the following would happen:

 

If the rep is in a lead list view, they would have the ability to check more than one record/lead and click the custom button, for example - left a voice, and it would update the respective records.

 

I am not a developer and have no experience writing code or VF pages.

 

Any assistance is greatly appreciated.

 

Thanks

Adam

BewitchedBewitched

Hi,

 

I have done this for Opportunity and same thing is possible with Lead as well.

 

<apex:page standardController="Opportunity" recordSetVar="unused" sidebar="false">
<apex:form >
<apex:pageBlock >
<apex:pageMessages />
<apex:pageBlock >
Note: All modifications made on the page will be lost if Return button is clicked without clicking the Save button first. 
</apex:pageBlock>
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}"/>
<apex:commandButton value="Return" action="{!cancel}"/>
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!selected}" var="opp" id="table">
<apex:column headerValue="Opportunity Name Edit">
<apex:inputField value="{!opp.name}"/>
</apex:column>
<apex:column headerValue="Amount">
<apex:inputField value="{!opp.Amount}"/>
</apex:column>

<apex:column headerValue="Account Name">
<apex:inputField value="{!opp.AccountID}"/>
</apex:column>

<apex:column headerValue="Opportunity Owner">
<apex:inputField value="{!opp.OwnerId }"/>
</apex:column>



</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

 Simply create a Custom button and assign a VF page to it.  should be a list button and assigned to search layout..

 

If this solution helped you than mark it as solved..

 

Thanks,

Tulika

AB12AB12

Thanks for your suggestion, however I have no coding experience so to be honest, I do not know how to change it form Opportunity to Lead.

 

Any assistance is greatly appreciated.


Adam

AB12AB12

Thanks for your suggestion, however I have no coding experience so to be honest, I do not know how to change it formOpportunity to Lead.

 

Any assistance is greatly appreciated.


Adam

BewitchedBewitched
<apex:page standardController="Lead" recordSetVar="unused" sidebar="false">
<apex:form >
<apex:pageBlock >
<apex:pageMessages />
<apex:pageBlock >
Note: All modifications made on the page will be lost if Return button is clicked without clicking the Save button first. 
</apex:pageBlock>
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}"/ >
<apex:commandButton value="Return" action="{!cancel}"/>
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!selected}" var="opp" id="table">
<apex:column headerValue="Lead Name Edit">
<apex:inputField value="{!opp.name}" />
</apex:column>

</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

 Hi try out the above code..changed to lead..