Hot answers tagged

6

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:...


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&...


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" />


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

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.


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 ...


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 }


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'}"&...


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.


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.


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" ...


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