Skip to main content
14 votes

Get button name or Id in LWC?

id shouldn't be used, because it is used by the framework for rendering purposes. Instead, just use a data attribute to specify the name: <button data-name="myButtonName" ... /> ... ...
sfdcfox's user avatar
  • 502k
12 votes
Accepted

ShowToastEvent notification is not displayed in LWC

As you can see here platformShoToastEvent can only be used in Lightning Experience explicitly. Since standard toasts are based on Appliacation Events there is nothing to handle your event in Lightning ...
Bartosz Śliwiński's user avatar
11 votes

Dynamically changing lightning button icon name with setAttribute not working

setAttribute is for setting HTML attributes. For component attributes, use direct assignment: event.target.iconName='utility:check" If you use query selectors, just remember that if it's not an HTML ...
sfdcfox's user avatar
  • 502k
11 votes
Accepted

LWC: Only enable button if options are available

You need to use the property with the get method. JS get disableButton(){ return !(this.options && this.options.data && this.options.data.length); } HTML <lightning-button ...
Rahul Gawale's user avatar
  • 12.3k
10 votes

Button sound in LWC

What you're likely experiencing is a limitation imposed by Salesforce CSP. In order to make it work, you need to Manage CSP Trusted Sites. Go to Setup | CSP Trusted Sites, and add the site to enable ...
sfdcfox's user avatar
  • 502k
8 votes
Accepted

LWC Button pass a value to the JS Method

LWC components dispatch a CustomEvent To get data out of this component, the convention is to look for event.detail.value if it's a publicly exposed value on that component. If you are in the same ...
Caspar Harmer's user avatar
7 votes
Accepted

Custom Button on Lightning Experience

Please refer to this: https://help.salesforce.com/articleView?id=actions_in_lex.htm&type=0 In Lightning Experience, actions display in the Global Actions menu in the header, on related lists, on ...
Charles T's user avatar
  • 11.1k
7 votes
Accepted

How to have both Icon and text inside a button in LWC

You just need to specify the label as well as the icon-name in the button. <lightning-button variant="success" label="Approve" title="Approve" onclick={handleApprove} icon-name=...
Mitch Spano's user avatar
  • 1,635
6 votes

Read value attribute in lightning button in the client js controller

Now you can use event.getSource().get("v.value") function to get lightning button value when clicked. From the Salesforce documentation: In the client-side controller, you can use one of the ...
Manuel Baquero's user avatar
6 votes

Align SLDS buttons to right

You should be able to use the SLDS Float classes: <div id="hidden"> <div class="slds-float--right"> <!--Add Folder Button--> &...
sfdcfox's user avatar
  • 502k
6 votes
Accepted

Unable to disable a button in lightning

The v. prefix is used to access aura:attribute values. To invoke a controller method you need to use the c. prefix i.e.: onclick="{!c.clickHandle}" See e.g. Trailhead's Handle Actions with ...
Keith C's user avatar
  • 137k
6 votes
Accepted

Can anyone suggest how to do an animation effect like Standard Refresh button do in Lightning Component?

It is created via following css class: .forceListViewManagerHeader .rotate svg { animation: rotate .4s; } Check the screenshot also
oozkan's user avatar
  • 599
6 votes
Accepted

How to execute one method after the previous got executed

In this case, you just need to use setTimeout: saving : function(component, event, helper){ component.set("v.dis",'true'); setTimeout($A.getCallback(helper.callhelper.bind(this, component, ...
sfdcfox's user avatar
  • 502k
5 votes
Accepted

"Log in to Community as User" Button Missing

With Winter '18, Users can manage Community Users in Lightning Experience. Snippet from the release notes: No more switching between Lightning Experience and Salesforce Classic to manage external ...
Jayant Das's user avatar
  • 30.7k
5 votes

Why are Lightning Actions for Case Object showing in Feed?

This is a expected behaviour from salesforce when feed tracking is enabled for cases or work orders, the page-level action menu on those records contains only custom buttons and supported standard ...
sanket kumar's user avatar
  • 15.6k
4 votes
Accepted

APEX Code with Pardot and Salesforce

Don't use new lines randomly. In this case, you broke up {!$Api and .Session_ID}, so the system didn't recognize the merge field correctly. The formula should look exactly as shown in the doc, one ...
sfdcfox's user avatar
  • 502k
4 votes
Accepted

Javascript Button User Permissions

You can use sforce.connection.describeSObject, which gives you an DescribeSObjectResult, which includes the fields, and if they're createable and/or updateable. This describe result respects profile ...
sfdcfox's user avatar
  • 502k
4 votes
Accepted

How to get all buttons in my page from a controller javascript function(component, event, helper)?

Add an aura:id to the <ui:button /> component, then find the button by it. component: <ui:button aura:id="btn" label="A" press="{!c.disableMe}"/> <ui:button aura:id="btn" ...
Praveen's user avatar
  • 10.1k
4 votes
Accepted

AfterRender on button in Lightning Component (DOM update)

I would not use afterRender to attach events, as you'll end up possibly adding duplicate events. Here's a simplified version that does not rely on a renderer: <aura:application > <div id=...
sfdcfox's user avatar
  • 502k
4 votes
Accepted

Trying to center button on page

In order to align a button in the center. we need to use the Absolute Center class in slds positioned. <div class="slds-align_absolute-center" style="height:5rem"> <lightning:button />...
Pavan tej's user avatar
  • 1,410
4 votes
Accepted

Lightning button icon without border

As sfdcfox already said That border is there to indicate active focus..... but if you still want to remove it assign a class to button icon like this <lightning:buttonIcon iconName="utility:like"...
User6670's user avatar
  • 3,045
4 votes

How to color the utility icons in lightning datatable in LWC?

There are 2 problems that prevent us from using "Styling Hooks" to achieve custom styling. Per documentation, --sds-c-button-text-color is not available for use in any of the lightning-...
Aditya Naag's user avatar
4 votes

Why can't I get rid of the 'X' button on my LWC Modal? I have a 'Cancel' lightning button so the 'X' is not needed

lightning__RecordAction with actionType set to ScreenAction provides a modal for you. You don't need to use SLDS modal markup when you use this type. See lightning-quick-action-panel for an example of ...
sfdcfox's user avatar
  • 502k
4 votes
Accepted

How align button to the right?

You first need to occupy the whole space. You have mentioned size="3" and size="4" which means, you only occupied 7 out of 12 grids. You need to change it to <lightning-layout ...
Nagendra Singh's user avatar
4 votes
Accepted

Aligning button next to lightning card title

Documentation: title is available as an attribute or a slot. Pass in the title as a slot if you want to pass in markup, such as making the title bold. Just use the title slot instead of the title ...
RubenDG's user avatar
  • 9,582
3 votes
Accepted

How to Disable edit button in Child Records

You cannot "directly" remove these buttons, as they are related to the user's permissions and generated dynamically. If you remove the `Cluster Field Configurations: Edit" permission from the user's ...
sfdcfox's user avatar
  • 502k
3 votes
Accepted

Formula for writing a specific Day of Week date value?

A quick Google revealed this: CASE( MOD(TODAY() - DATE(1900, 1, 8), 7), 0, TODAY() + 7, 1, TODAY() + 6, 2, TODAY() + 5, 3, TODAY() + 4, 4, TODAY() + 3, 5, TODAY() + 2, 6, TODAY() + 1, DATE(9999,01,...
Keith C's user avatar
  • 137k
3 votes

Is there a apex command button that allows you to not refresh the page?

Ok, there are a couple of things going on here: When you include merge syntax in javascript they do not get updated when the properties in the controller get updated unless you rerender them. When I ...
Eric's user avatar
  • 54.4k
3 votes
Accepted

Rename Standard new related list button

No, you cannot rename the standard buttons. You'll have to create a new button then uncheck the new button from the related list buttons. To create the url hack a tutorial I found is here: http://...
Dan Wooding's user avatar
  • 3,731
3 votes
Accepted

Lightning button to update a record

A couple of things, Your getCase method returns an object of type "case", But, you are setting the object to a String in the init method of your js Controller.Additionally, as N.B pointed out, you ...
Sumuga's user avatar
  • 2,209

Only top scored, non community-wiki answers of a minimum length are eligible