Skip to main content

Questions tagged [custom-button]

Create custom buttons and links to integrate Salesforce data with external URLs, applications, your company’s intranet, or other back-end office systems.

Filter by
Sorted by
Tagged with
46 votes
2 answers
11k views

Changing the color of a custom button

Is there a way of changing a custom button color? Not a button on the visualforce page but rather the ones created under custom and links on an object. Thanks. -K
Kenn K's user avatar
  • 885
27 votes
3 answers
57k views

How do I get the base URL in the formula editor?

I'm building a custom button that when clicked creates a task. In the task comments, I'm building a URL to direct the assignee to the Account Team add page. I need to know the instance I'm on in order ...
Daniel Hoechst's user avatar
33 votes
2 answers
41k views

Creating a custom list-view button that handles multi-record selection

I would like to create a custom button for a list-view that applies the same action to all the selected records in the list view. For instance, in the Cases list-view there are the Change Status and ...
Joe's user avatar
  • 3,421
21 votes
3 answers
23k views

Best practice for calling Apex methods from custom button?

I want to put a custom button on a standard detail page layout to execute Apex code, and I'm wondering if using VF page action attribute is the best practice. Here are the details. When the user ...
David's user avatar
  • 405
21 votes
2 answers
26k views

URL Hack: Pass additional parameters into the saveURL

I'm pretty good with URL hacks to set field values in a record, save=1, saveURL/retURL, etc... But I'm getting stuck on something I've never tried before and I don't even know if it is possible. Is ...
Jason Paquette's user avatar
8 votes
2 answers
37k views

Custom List view buttons in the lightning environment

I have a requirement where I want to have a custom list view button with an ability to perform a mass custom action in the Lightning environment. I do not see an option to add lightning quick-action ...
Darshan Chhajed's user avatar
10 votes
1 answer
15k views

How to get custom URL Button to display on Lightning record page?

I know lightning doesn't support javascript buttons. I know there are alternative routes to do this with actions, lightning components, and visualforce. I'm asking how to do something that according ...
Ralph Callaway's user avatar
8 votes
2 answers
10k views

Sending Email using Email Author in custom button

I have tried this code for custom button for single click email sending. Unfortunately it is not working and returns an error. Could anyone tell me what I am doing wrong and correct me please. Thank ...
SFDC_BigDog's user avatar
4 votes
4 answers
24k views

Calling Apex Class from Custom Button, And Then Refreshing List View

I have added a Custom Button to the List View of the Custom Object. What is the best practice of calling an Apex Class on click of the Custom Button, and refresh the List View after execution of the ...
Shumon Saha's user avatar
  • 4,642
1 vote
2 answers
7k views

Custom "New Contact" button on Account detail page

I've a created a custom button on Contact object and added this to Contact Related-list on Account's Page layout. I want this to depict same functionality as standard "New Contact" button does. If use ...
doga's user avatar
  • 4,595
1 vote
1 answer
3k views

Problem with passing parameter through URL to an LWC present inside a lightning tab

I have a detail page button on Account Detail page. I wish to open an LWC on clicking the button. The button opens a lightning tab using URL and passes a parameter along with the URL. I have an LWC on ...
Koustubh's user avatar
  • 1,203
1 vote
2 answers
9k views

It is possible to hide/show a custom button?

I have created a custom button for creating a contract from an opportunity. I would like to hide this button unless the opportunity stage is equal to Closed/Won. Is that possible? How can I implement ...
Guillermo's user avatar
  • 399
1 vote
1 answer
2k views

Case Emails - Custom Button - TO field not populating properly

https://na4.salesforce.com/_ui/core/email/author/EmailAuthor? p3_lkid={!Case.Id}&retURL=%2F5{!Case.Id}& [email protected]:Customer%20Service I have gone back and forth with this code, ...
AMM's user avatar
  • 4,724
10 votes
0 answers
636 views

Trigger page message in the parent page from the Controller Extension of a custom list view button

Is there any way to trigger the display of a page message in the embedding Detail page from the Controller Extension of a Custom list view button? I create my list view buttons with this technique ...
Robert Sösemann's user avatar
10 votes
1 answer
30k views

How to show a screen flow as a Listview button on any object?

Actually, I know how to show a screen flow in custom action but wanted to know - Is there any mean to show a screen flow as a list view button? and if yes then how? Thanks in advance.
Amit Kumar's user avatar
8 votes
5 answers
14k views

Proper urlencoding of spaces in formulas syntax

1 week ago user has asked me to display a custom link on Account that would point to another system we use. Really straightforward stuff, idea being that user is already logged in to both SF and that ...
eyescream's user avatar
  • 24.1k
8 votes
2 answers
23k views

Javascript SOQL Query in a Button

I am trying to runa query in a .js button to pull out an ID of a contact that is associated with a record so I can auto send an EchoSign document. However I can not get this working, my googling ...
Tim's user avatar
  • 1,393
7 votes
2 answers
2k views

Using static resources in OnClick Javascript buttons after "Serve Static Resources from force.com domain" critical update

We're using list view and details OnClick Javascript buttons which reference custom js ans css files stored in static resources and containing some shared logic/styles. The sample code below ...
Victor's user avatar
  • 413
5 votes
4 answers
6k views

Cancel Button Implementation Problem

i am creating a custom vf page without any standard controller. And i need to implement cancel button functionality. following is the code i am using: Visualforce <apex:commandbutton value="...
Shoaib Shakeel's user avatar
4 votes
1 answer
3k views

How to convert mass actions on list view records from Classic to Lightning Experience?

We have multiple JavaScript buttons that follow this pattern where the set of checked records in a list view are first checked and then a server side operation is applied to them: {!REQUIRESCRIPT('/...
Keith C's user avatar
  • 137k
4 votes
1 answer
10k views

Open jQuery Dialog from Custom Button

We have a custom button on the detail page of the case designed to open a modal dialog popup, however receiving the $g(...).dialog is not a function error message. I've searched around the web and can'...
GeorgeA's user avatar
  • 984
3 votes
1 answer
4k views

Custom Button and Link can't use VF Page

I am creating a new custom button or link, and when i try to use a Visualforce page my content dropdown list is empty. How do i get a VF page to trigger on a custom button or link.
user5619's user avatar
2 votes
1 answer
4k views

Unexpected Identifier for Onclick Javascript button

I created a custom button for custom object to place in the related list. The custom object has two look-ups, one for case and one for account. This button, when clicked, should open in a new window ...
Ian Bury's user avatar
2 votes
1 answer
2k views

OnClick JavaScript Button, Invalid or unexpected token error

Here is the field I am trying to update, the far left is the picklist I am wanting to update. the field on the left is another picklist. both lists have the same values. As you can see below I have ...
Cameron Houser's user avatar
2 votes
1 answer
13k views

Query on permission sets held by a user

Does anyone know a basic way that I can run a SOQL query to see which permission sets are attached to users? We have a rather large issue where a button needs to be on a page layout for a few ...
Tim's user avatar
  • 1,393
2 votes
1 answer
1k views

Does $Action.New not prompt the user to select Record Type?

I have Task object with few record types. I created a custom List button on the task object and placed it on the related list of few objects. When i click this button i expected that it would prompt ...
Shailesh Deshpande's user avatar
2 votes
3 answers
10k views

How to create custom buttons

I am new person in salesforce. Can any one please detail explanation of how to create custom Button in either standard object or custom object?
bhaskar's user avatar
  • 19
2 votes
1 answer
9k views

How to send email on custom button using Javascript

I have created custom button to send visualforce page url with opportunity id in opportunity detail page. How can i send URl like 'https://c.ap1.visual.force.com/apex/QuoteOrderForm?id=0069000000DOa0Q'...
Reddy's user avatar
  • 869
1 vote
1 answer
578 views

User validation on Custom Button

I have a custom button on the Product object that I only want to run if the current logged in user is either the record owner, a specific user id, or a sys admin profile. How would I do that? Below is ...
Glenn Daly's user avatar
1 vote
1 answer
2k views

how to assign the date and time value in javascript?

I want to assign current date and time to field Rfleet_Protocol_Application_Date__c which datatype is date/time Eg: Rfleet_Protocol_Application_Date__c =29/5/2016 2:28 PM I tried in this way. But ...
kiran's user avatar
  • 13
0 votes
2 answers
35 views

Apex errors with Custom button to add existing records on a custom object

I am receiving apex errors with the following code: public with sharing class AddExistingSpecsExt { public Specifications__c loadedSpec { get; private set; } public AddExistingSpecsExt() { ...
Jason's user avatar
  • 121
0 votes
2 answers
1k views

Onclick on ok on Javascript can we update custom field

I want to update field on click of ok in the javascript popup message. Is there any way that i can do in custom button javascript code like we have checkbox field and when i click on ok in the ...
Josyula's user avatar
  • 661
0 votes
2 answers
2k views

Lightning component Buttons are not working as expected

I am trying to have two buttons on my lightning component like below Component <aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" controller="...
user81642's user avatar
  • 687
10 votes
2 answers
18k views

Use a Custom Label in a Custom Link/Button

Is there a way to use a custom label in a javascript custom button ? for example: var targetUrl = encodeURI("http://{!$Label.targetHost}/what/ever?user={!$User.Username}");
Martin's user avatar
  • 385
10 votes
3 answers
20k views

Custom Button Return URL (retURL)

I am using a custom button to execute a flow and a retURL tag to return to the record after the flow has been completed. /flow/SAMPLEFLOW?RecID={!OBJECT.Id}&retURL=https://na10.salesforce.com/{!...
Justin J Carlson's user avatar
7 votes
8 answers
47k views

Refresh the page after the flow completes

I have an auto launched flow that updates the Status of the Case to be closed when the button is clicked. The flow is like below I am calling the flow through the Detail Page Button using the URL ...
user81642's user avatar
  • 687
7 votes
1 answer
1k views

Salesforce URL Hacking - Ability to remove the 'multiple items found' error

I've created the following custom button on my custom object to automatically lookup the contact and account names when the custom 'new' button is selected from a contact's related list: /a0H/e?...
user21827's user avatar
6 votes
2 answers
1k views

Looking for Lightning Alternative for Javascript Detail Page Toggle Button

In classic we could use a custom button with some JS to create a simple toggle functionality. Cf. Javascript Detail Page Toggle Button What would be a valid lightning experience alternative (...
Christian Szandor Knapp's user avatar
6 votes
1 answer
2k views

Avoid record type selection with URL button

I'm creating a url button to avoid the record type selection: This is the code: {!URLFOR($Action.Case.NewCase ,null ,[RecordType="01220000000Q3cy"])} The problem is that i'm still getting the page ...
Enry's user avatar
  • 3,736
6 votes
3 answers
4k views

invalid type sobject type ApexClass is not supported

I'm in a test org where I've installed my managed package. I have a javascript button that is utilizing the AJAX Toolkit to get the namespace dynamically but its not working in this org (it works fine ...
Phil B's user avatar
  • 5,026
6 votes
4 answers
3k views

javascript date on custom button issue..?

When i click on this custom button i need to fill a field with the current date and time.But some times its giving me a previous date i.e exactly 1 day prior to current date..i dont know why this is ...
miku's user avatar
  • 1,761
5 votes
2 answers
966 views

OnClick JavaScript in PE

On a project for a client I am using a field on Opps as part of a conditional formula field on Opps Prod. The result of that formula needs to be able to be summed from all Opp Prods, and the total ...
Jenn's user avatar
  • 51
5 votes
1 answer
2k views

How to change label on custom button based on value in the record being displayed?

I want to add a custom button to the Quote object where the label of the button changes based on the value of a custom field on the record. I want the label change to occur when the page is rendered ...
debraSF's user avatar
  • 315
5 votes
1 answer
3k views

Pass a parameter to custom link/button

I have a custom button in my org that, when clicked, brings the user into an external application. That external application sends an email to other users with a link to the URL of that custom button ...
CDelaney's user avatar
  • 462
5 votes
3 answers
11k views

How to build a SalesForce Custom Button with "validation" rules

Need a custom botton on an opportunity page to execute a task only after a set of validation checks have been preformed. Meaning the button will only function IF a list of fields and pick-lists have ...
user2415's user avatar
5 votes
1 answer
7k views

How to get/pass parameter to VF page via JS? How to update field with value from VF page? (updated with BOTH parts)

1st part I have a long-ish question and I will break it into two parts. First, how to pass parameter to VF page via Javascript? I want to click a button and it will take me to VF page and give it ...
fraglord's user avatar
  • 323
5 votes
2 answers
4k views

Can I hide a custom button on standard page based on some field value?

I want to hide a standard or custom salesforce button on standard page. I don't want to use record type based layout to do that.
Mehebub Hossain's user avatar
5 votes
4 answers
5k views

Provide standard clone button functionality to a button on vf page

I have an object whose standard new, edit and view button are overridden with a vf page.I want a Clone button on this vf page which should work exactly like standard clone button. If suppose i open an ...
SFDC_MJ's user avatar
  • 635
4 votes
3 answers
6k views

How to call a WebService method from a Lightning Component that replaces a Classic JavaScript button?

We have JavaScript buttons that follow this pattern: {!REQUIRESCRIPT('/soap/ajax/39.0/connection.js')} {!REQUIRESCRIPT('/soap/ajax/39.0/apex.js')} var ok = confirm('Create the Interest Adjustment?');...
Keith C's user avatar
  • 137k
4 votes
1 answer
759 views

Pass Case Ids collection to visual workflow from Case List View Custom Button and update cases taking from input screen

Requirement From Case list View, user will choose one or more cases and will click on "Update Due Date" button, where it will show a screen to choose the "Due Date". Due Date screen And finally ...
Santanu Boral's user avatar