Skip to main content

New answers tagged

0 votes

VisualForce page data not displaying after adding to 'Notes and Attachments'

As the documentation states, you need to use getContentAsPDF(), not getContent().
David Cheng's user avatar
  • 7,099
0 votes

LWC Tabset - edit size of lightning-tab

No, this is not possible. First of all, there is no respective option in the documentation you're pointing out. There are neither any respective styling hooks listed in the context of the Lightning ...
Felix van Hove's user avatar
0 votes

Remove "Add Files" button from Files Related List component on Standard Lightning Record Page

Since we cannot modify the permissions or the out-of-the-box (OOTB) button, one potential solution is to create a custom component using an LWC datatable. You can try the solution below and further ...
Shreya Mathur's user avatar
1 vote

Accordion not rendering nested array elements in LWC Html

It appears that the Salesforce implementation doesn't support nested accordions properly, even though the Accordion blueprint does. As such, you'll have to write your own custom component to control ...
sfdcfox's user avatar
  • 497k
0 votes

Can we use speech recognition functionality using microsoft-cognitiveservices-speech-sdk in lwc?

It seems to be possible, as it is stated in the home page: The JavaScript versions of the Cognitive Services Speech SDK supports browser scenarios as well as the Node.js environment. In theory, all ...
Renato Oliveira's user avatar
1 vote

Validate method breaking jest test

If you are happy omitting the validity check (and indeed I don't think this makes sense to test at all), add this to your test to make sure checkValidity() is always true: [...parent.shadowRoot....
Felix van Hove's user avatar
0 votes

lightning-input-rich-text value property does not correspond to the actual content displayed

This worked for me HTML lightning-input-rich-text class="myclass" value={myVal} onchange={handleChange}> </lightning-input-rich-text> JS: ...
Pooja's user avatar
  • 1
1 vote
Accepted

How to dynamically pass key and get value in an iterator in LWC html

Unlike Visualforce and some other languages, you can't dynamically choose a field from an object/map in LWC. It's just not supported. Instead, you'll need to create a structure where you have an ...
sfdcfox's user avatar
  • 497k
0 votes

Get the record type name instead of Record Type id in LWC component

Javascript Code to get Record Detail: import { getRecord } from 'lightning/uiRecordApi'; //FIELDS is the array of fields @wire(getRecord, { recordId: '$reactiveRecordId', fields: ...
Vishal's user avatar
  • 1
2 votes
Accepted

Lightning datatable display data from apex controller

Data tables require an Array to display data. As such, your data needs to be an Array. Consider just returning a List of records, like this: @AuraEnabled(cacheable=true) public static CustomObject__c[]...
sfdcfox's user avatar
  • 497k
0 votes

How can I append dynamic value with Href static URL <a href="someUrl" + recordId>

Instead of using href, you can use lightning-button. html <template> <lightning-button label="Contact Broker" onclick={navigateToLink}> </lightning-button> &...
Shreya Mathur's user avatar
1 vote
Accepted

Salesforce screen flow - Update record element works intermittently

Considering that the update of records and screens are loading one after the other, there is a possibility that the next screen may or may not load the latest values. Try these two workarounds if ...
Shreya Mathur's user avatar
1 vote

In LWC, how can I make a lightning-button use the full width available to it?

Update Winter '23 You can use the stretch attribute of the lightning-button to achieve that: For example: <div> <lightning-button variant="brand" label="Get ...
Sebastian Kessel's user avatar
1 vote

LWC component to search Account records not displaying data

In your HTML template, you can only use variables defined inside the JavaScript class. The columns variable is currently defined outside the class, which makes it a static variable. Because of this, ...
Sufyan Ashraf's user avatar
3 votes

How to put a variable/recordId in anchor tag <a href="somelink"+{acc.id} >"

LWC doesn't allow such expression in the template, so if the first part of the link is static and acc is an instance variable, you could have a getter in your JS class returning the whole url: JS: get ...
RubenDG's user avatar
  • 8,752
2 votes
Accepted

LWC component to search Account records not displaying data

The template (HTML file) can access only instance variable: the variable must be defined inside the JS class. columns is defined outside the class, so it's a static variable, therefore the datatable ...
RubenDG's user avatar
  • 8,752
0 votes

Changing lightning-card height

By default when you use the lightning-card CSS apply display: inline;. That's why when you apply your custom CSS for the height will not apply. You can try setting the display to something other than ...
Tushar Jadav's user avatar
  • 2,148
1 vote
Accepted

How to Create an LWC Component to Show a Warning When the Industry Picklist Value Changes on a Salesforce Standard Account Page?

This use case can be addressed by Change Data Capture (CDC) First, we need to enable CDC for Account object from below setting: Setup-> Integrations -> Change Data Capture. After Saving , ...
Rohit's user avatar
  • 2,081
0 votes

CSS styling hooks not applying for lightning-badge in LWC

--slds-c-badge-color-background: rgb(6, 6, 155); is working in my case. Can you check following? Make sure the CSS file name is correct. It should be exactly same as component name. Make sure the CSS ...
Abhilav Srivastav's user avatar
0 votes
Accepted

How to Determine when LWC ForEach Loops has completed

The issue you're encountering is due to the asynchronous nature of JavaScript. The forEach method is synchronous, but its callback functions might include asynchronous operations that prevent the ...
Sufyan Ashraf's user avatar
0 votes

Why LWC component is reloading due to the recordtypeId is changed in Record Edit Form

UNFORTUNATELY, to solve this issue I have to remove the recordtypeId field from the list and use a text field instead to store the recordtype and show in UI. Reasons of page loading is unclear. Most ...
Mrinal Sharma's user avatar
2 votes

LWC equivalent of lightning:unsavedChanges?

WARNING: This is a solution based on an experimental API only available in the Chromium browser family. It is not supported by Safari or Firefox. I tried using the beforeunload event, but since the ...
Phil W's user avatar
  • 37k
0 votes
Accepted

create an LWC to display hyperlinked Record Name

You can use the getRecord wire adapter to fetch the record data and then construct the URL dynamically based on the recordId. HTML: <template> <lightning-formatted-url value={...
Tushar Jadav's user avatar
  • 2,148
0 votes

LWC component is not storing values in screen flow

@api properties are read-only except during class initialization, so you cannot initialize them in connectedCallback(). You should be able to do this: @api language = localStorage.getItem('language'); ...
sfdcfox's user avatar
  • 497k
3 votes
Accepted

How does persistent browser caching work internally?

What the option does is exactly what it says: enables caching on the client side (the users' browsers) to improve performance by reducing the number of calls to Salesforce's servers. This includes not ...
Renato Oliveira's user avatar
0 votes

Colspan not working in SLDS lightning Salesforce LWC

rowspan isn't working, because you put it on the div instead of the td. However, you'll need to change more than just that. SLDS just isn't compatible with rowspan; the styles end up forcing the cells ...
sfdcfox's user avatar
  • 497k
0 votes

How to Determine when LWC ForEach Loops has completed

On finding & generally the following it has helped me to achieve what I've needed. https://community.appsmith.com/content/guide/how-correctly-execute-loop-synchronously-javascript
RedQueries's user avatar
1 vote

Pass collection variable from LWC back to Flow

update to show creation This is a simple proof of concept using the same metadata markup and I was able to pass back a list of custom object records (payment__c) records from LWC to flow and then ...
BritishBoyinDC's user avatar
0 votes

Will there be a responsive datatable component soon?

Looks like the answer to this question is NO.
Keith C's user avatar
  • 136k
1 vote

LWC counterpart for aura's force:outputLookup

There is no analog for this element directly, as you can now use lightning-record-view-form and lightning-output-field: <lightning-record-view-form record-id={recordId} object-api-name={objectName}&...
sfdcfox's user avatar
  • 497k
0 votes
Accepted

Salesforce get Draft and other row data

Only the id and changed values are found in draftValues. You can find the original row data to determine custom logic rules. handleCellChange(event) { // Match the rows in this.data with event....
sfdcfox's user avatar
  • 497k
0 votes

LWC Component to stay on same tab if user clicks on the Cancel button in alert

You'll have to manually set the tab: <lightning-tabset lwc:ref="tabset"> if(confirm(confirmMessage)) { this.hasUnsavedChanges = false; this.refs.tabset.activeTabValue = 'tab2'; } ...
sfdcfox's user avatar
  • 497k
1 vote

data is not showing on UI screen what is error in my program plz ans if any know this what mistake i m doing in this

You have declared searchInput twice in your JavaScript file. In your @wire service, you're using searchInput: '$searchKey', but searchKey is not defined anywhere in your code. You should use ...
Tushar Jadav's user avatar
  • 2,148
1 vote

I Have a LWC DataTable which I am using inside a ScreenFlow to display the value on the UI but for mobile I need a different UI. How can achieve that?

To create custom UI, use a mixture of the LWC Components and the SLDS Classes. You will have to write your own loop - see Render Lists - and take care of the layout details such as acting on button ...
Keith C's user avatar
  • 136k
0 votes

LWC -ightning/uiObjectInfoAPI - getting INSUFFICIENT_ACCESS error for custom object

I don't have as answer, but am experiencing a similar problem. The issue I'm having is with the bulkified version, getObjectInfos, which takes an array of sObject names as the parameter. Those ...
PatMcClellan__c's user avatar
1 vote

Styling Issue with rendering Lightning progress indicator

Delay rendering the steps until you have data: <lightning-progress-indicator lwc:if={stages} current-step="3" type="path" variant="base"> In addition, don'...
sfdcfox's user avatar
  • 497k
-1 votes

Setting component visibility filters within the html/css/js LWC code instead of Web UI

Not a fan of either of these two methods. I think we are trying to show/hide certain fields on forms as they are filled out, to keep them clean. edit* Just found a person that found a GIT repo ...
user1040975's user avatar
2 votes

Using the <template> vs <div> for conditional rendering

Historically, there was a point when you had to use template for conditional rendering, because other tags might render incorrectly due to a bug. Further, there was a point where there were two ...
sfdcfox's user avatar
  • 497k
2 votes
Accepted

Using the <template> vs <div> for conditional rendering

Personally I make the choice of using <template> or a tag that renders in the HTML e.g. <div> based on readability. If your HTML is carefully indented, adding <template> tags messes ...
Keith C's user avatar
  • 136k
1 vote

JS classList not working

Instead of selecting the lwc button by name we can select it by the data-id attribute like below : for(let j of this.visualPickerData){ if(j.pDetail.length <= 1){ const buttons = this.template....
Rohit's user avatar
  • 2,081
1 vote

How to implement array contains functionality , in LWC component?

The code in the question is of Aura component.The answer would remain same We can use either includes or indexOf JS array method here. Below code can be used - var contactId = event.getSource()....
Rohit's user avatar
  • 2,081
1 vote

getting confused with making my own salesforce admin roadmap

There's lots of ways to get better at Salesforce. Consider going through the Admin Super Set on Trailhead. By completing this set, you'll be a very knowledgeable Admin. It looks like a lot of work, ...
sfdcfox's user avatar
  • 497k
0 votes
Accepted

Emails not being sent from a quick action linked to LWC

Since you found the following error in your email log: Unauthenticated email from premierpet.com.br is not accepted due to domain's DMARC policy. Please contact the administrator of premierpet.com.br ...
sfdcfox's user avatar
  • 497k
0 votes
Accepted

If mouse over for more than x secons show popup

So, not to block the execution of your code's component, what you are looking for would be to have some state variables in your component to track whether or not the counter is up and counting, or not....
Renato Oliveira's user avatar
1 vote

How to increase file upload limit to 100 mb using visualforce page in salesforce

You simply can't upload a file of 100MB in Apex. Instead, use apex:remoteObjects or the AJAX Proxy. Either of these should allow you to upload much larger files. Also, the suggestion about using the ...
sfdcfox's user avatar
  • 497k
0 votes

Best practices for taking an SSN or any other PII as input and storing it in salesforce

Depends on what your security requirements are. If you need to grant access to a full sandbox that contains a copy of production data to third-party personel, for example, you could not copy data over ...
Renato Oliveira's user avatar
2 votes

Any problem passing a Salesforce security review if LWCs are using GraphQL?

To be certain, this question really should be directed to Partner Support. That said, it would be unreasonable to assume that GraphQL is inherently insecure relative to using something like getRecord ...
sfdcfox's user avatar
  • 497k
1 vote

How can I open a blob file on a new tab with Lightning Locker enabled?

The SecureWindow instance (which replaces window) does not support opening blob files. What happens when you try to do so is that you get this error: Error: SecureWindow.open supports http:, https:, ...
Renato Oliveira's user avatar
0 votes
Accepted

How to add LWC Global action in FSL

Actually, it is visible on FSL app once LWC is called directly, but calling LWC from Aura will not work on FSL. Since aura is not supported on FSL (it is not written anywhere in the salesforce ...
Ashesh Kumar's user avatar
0 votes

Not Able to update version of LWC component

i tried saving with lightning studio i were able to save with updated API version
garvi's user avatar
  • 63

Top 50 recent answers are included