New answers tagged

5

Currently, there is no native solution for replacing custom labels tokens with dynamic values in LWC. But you can implement similar functionality using pure js. Let's create some service LWC component IntlService to be able to reuse its functionality from everywhere: class IntlService { static format(stringToFormat, ...formattingArguments) { if ...


4

There has no such limitation that you can't get the record id on User Record page through force:hasRecordId. I have tried a simple code and it works perfectly fine:- Component:- <aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:...


1

Documentation link This interface has no effect except when used within Lightning Experience, the Salesforce mobile app, and template-based communities. You need to find another way for getting the userId.


1

I think it's just because lightning:input is a universal component that can return many data types including strings and even arrays. So I've seen some weird casting artifacts happen. What I'd suggest is, before sending to Apex, use the JS Number() function to change the string decimals into proper numbers. Then Apex will receive it without ambiguity.


0

a dirty workaround could be : @media screen and (max-width: 640px) { .THIS .slds-table_header-fixed_container { padding-top: 0px; } .THIS .slds-table_header-fixed { padding-top: 2rem; } }


2

You have to assign an aura:id to the second combo-box like below. <lightning:combobox aura:id="periodFreqs" name="periodFreqs" label="Statement Period Frequency" placeholder="Select a Period Frequency" options="{!v.periodFreqs}" onchange="{!c.selectFreq}"/> And in the Controller find this aura id and set the value to null. selectIssue: function (...


1

You have to build the map in JS as an object: let jsMap = { '0017F00000gqDetQAE': { 'ACCOUNTNUMBER': 'CD451796 -- new', 'PHONE': '(512) 757-6000 --' }, '0017F00000gqDevQAE': { 'NAME': 'Pyramid Construction Inc. --' } }; let stringForSendingToAPEX = JSON.stringify(jsMap); Then you will be able to deserialize this ...


2

There is no native SVG component support in aura, you have to use a custom SVG Component or use lightning:icon <lightning:icon iconName="utility:arrowdown" alternativeText="Arrow Down" />


1

You need to import import { NavigationMixin } from 'lightning/navigation'; and change your LWC name to extend Navigatio Mixin: export default class YourClassName extends NavigationMixin(LightningElement) { // Your code here }


2

I tried your exact code and it worked for me, both from markup and init handler in javascript <aura:application > <aura:attribute name="colorPalette" type="List" default="['red', 'green', 'blue']" /> <aura:handler name="init" value="{!this}" action="{!c.doInit}"/> <aura:iteration items="{!v.colorPalette}" var="item"> <p&...


1

To use Javascript and a lightning web component instead of aura you can use a dynamic class change variable for the section. <template> <div id="ExpandableCalendarSection" class={BookCalClass}> <h3 class="slds-section__title" style='padding-bottom:0;'> <button aria-controls="expandoBookingCalendar" aria-expanded="true" ...


0

A little bit changing and everything is okay! <aura:if isTrue="{!v.field.fieldType == 'url'}"> <a href="{!'/' + v.field.data}">{!v.field.data}</a> <aura:set attribute = "else"> <div class="slds-truncate" >{!v.field.data}</div> </aura:set> </aura:if>


0

The attribute in the child is of Type List, and the list doesn't have any attribute like fieldType, data. See your code below: <aura:attribute name = "field" type = "List"/> So if you are passing the list then you will need to use aura:iteration. If you want to add some extra data with list you can create a wrapper object like { fieldType: '', data :...


1

# is for 1 time binding, only the value passed/assigned before UI renders will be shown in UI and any further changes will not reflect in UI, so, it is recommended to use ! if you want to reflect the changes dynamically. Also you should use v. in component. Below change in soqlField component should work: <aura:if isTrue="{!v.field.fieldType == 'url'}"&...


0

Change this <c:soqlField field="{!field}"/> to <c:soqlField field="{!v.field}"/> . You are missing the access provider v.


1

Relevant LWC recipes Example. You can also just use force:hasRecordId and force:lightningQuickAction tag and use the record id from the parent aura component to pass it to a child LWC component. This will allow it to be used as a quick action.


0

Ok, ended up finding the answer, I used ontouchmove for detecting swipe events, event returns a touch object in an event.touches array edit: Index.cmp <div ontouchmove="{!c.touchmove}"><!--start touchcontainer--> IndexController.js touchmove: function(component, event, helper) { if(!event.touches || event.touches.length == 0)...


0

helper.getAccount is asynchronous. This means that until your init method has finished, myAccount will definitely be a null value, as you haven't had a chance to visit the server yet. You'll need to set mapMarkers after you've had a chance to load the data from the server. You'll want to read about how to Write Asynchronous JavaScript for more information on ...


1

For now, you can use an Aura Component to wrap your LWC component, then make that Aura Component a Quick Action. Doing this will allow you to add it to the page as a button in the upper-right menu for a record.


0

Just for the information. I had the same issue and as a workaround I implemented following. JS Code @track selectedRowIds = []; onRowSelection(event) { var rows = event.detail.selectedRows; this.selectedRows = []; this.selectedRowIds = []; rows.forEach(row => { if(!mycondition_to_disable) { this.selectedRowIds.push(...


0

First of all, aura:id="{!filter.id}" is not supported. You cannot use expressions in aura:id. Secondly, to get a hold of the value in question, you can use closest as a way to get an attribute up the DOM. That would look like this: <lightning:layout> <div data-filter-id="{!filter.id}"> ... handleFilterChange(c,e,h) { var filterId = e....


0

I made a method to use as a utility for making toast messages <aura:component description="AuraUtils"> <aura:method name="showToast" action="{!c.showToast}" description="Used to show a toast message" > <aura:attribute name="title" type="String" description="title of toast" /> <aura:attribute name="message" type="String" ...


Top 50 recent answers are included