The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [lwc-wire-adapter]

The tag has no usage guidance, but it has a tag wiki.

Filter by
Sorted by
Tagged with
0
votes
0answers
16 views

@wire(CurrentPageReference) pageRef is not working in Salesforce mobile app

I am using @wire(CurrentPageReference) to get data passed from previous page. Here is my code: In first page navigating to second page like this: this[NavigationMixin.Navigate]({ type: "...
2
votes
1answer
28 views

How to map fieldId type in LWC to Apex

I'm trying to implement a wire service to get data with passing schema items, but I'm getting an error that objectName can't be mapped to a String I'm including the relevant parts below LWC part ...
2
votes
2answers
36 views

Get record from apex controller using @wire chain

I want to receive a list of fields from a field set, and then query a list of records with those fields. At last, i want to show the data in a lightning web component. I have the following function ...
-1
votes
1answer
26 views

How to do @wire calls one after other in an order? [closed]

In LWC how to call multiple wire method in a sequence i.e.first wire call then second wire call and then third wire call and so on? The problem is they are not being called in same sequence every ...
1
vote
1answer
62 views

LWC Displaying Table Data using a Custom Class Issue

Im new to LWC development and am trying to get through an issue Im having. I want to use a custom class list to display a list of data in a data table. The data that Im populating manually (at the ...
1
vote
1answer
25 views

Intermittent @wire INVALID_FIELD error in LWC

I have an LWC component that utilises getRecord from the lightning/uiRecordApi module. It requests fields from a custom object record. import { LightningElement, api, wire, track } from 'lwc'; import ...
1
vote
1answer
91 views

When to use Slots vs Public Properties vs Getter Properties in LWC exactly?

I am learning LWC and I understood the concept of Slots & Public Properties. But I am not clear regarding when, in which conditions should we use Slots, Public Properties (@api) and Getter ...
0
votes
1answer
37 views

LwC Open Source posting information to endpoint

I'm collecting information from user entry and would like to POST the information to external RESTful API. I've read a little on the @WIRE service in LwC but not sure how post JSON to that service. To ...
4
votes
2answers
197 views

How to refresh wired service getRecord manually?

Please note that this is not duplicate of LWC Force Refresh Wire getRecord - this question and answer specifically speaks about changes in front-end/UI and capturing that in front-end BUT LDS cannot ...
0
votes
1answer
49 views

Cannot get any values from LWC @wire

Sorry, hoping I'm just doing something dumb here, but I'm really struggling with my first attempt at a lightning web component and was wondering if anyone can see what I'm doing wrong. So my ...
0
votes
0answers
28 views

LWC @track variable not causing rerender when it is reassigned from a refreshApex

My LWC code looks like: @api recordId; labels = { title, refresh }; @track showSpinner = true; @track checklists = []; dataForRefresh; @wire(getChecklists, {objectId: '$recordId'}) ...
0
votes
0answers
29 views

Lightning Web Component Scope

I have a event listener that is firing to handle the creation for new leads. Within the handler, I am calling a method to determine the source of the lead and identify the record type. However, one ...
0
votes
1answer
38 views

How to Navigate from one LWC to another LWC

I have two lightning web components and I have to navigate from one LWC to another LWC on button click. I tried navigation service to apply the NavigationMixin function in the component’s base class ...
0
votes
1answer
84 views

Why are my lwc variables not defined?

My Lightning Web Component operates as expected, data from the apex class is passed into the js class, and renders correctly in the lightning data table. However, in the @wire function, none of my ...
2
votes
1answer
196 views

Set dynamic map parameter of @wire method (LWC)

I have a method in my Apex controller that takes two parameters, a String and a Map< String, String>. For the plain String it evaluates correctly for me to pass a variable ‘$myVariable’ and the ...
3
votes
1answer
92 views

LWC Can't import Case Owner Name using Wire Service

I am building LWC component to include it in Case Record page. My lwc component should display current Case Owner Name. As per Salesforce LWC wire Service Ref, here is the way to fetch reference/...
0
votes
1answer
43 views

Show parent field in LWC

I have a wizard on case object. The idea is to help agents to fill up the necessary data. however, I have trouble to show parent field (i.e Account.Name) in LWC HTML file. Here is my code Controller ...
0
votes
1answer
46 views

What would cause an LWC @wire callout to fail?

I am building a Lightning Web Component that should create a click-configurable datatable that can be put on Lightning pages and show content in a variety of ways. To both build the table and retrieve ...
0
votes
1answer
65 views

Refresh lwc standard record UI by using getRecordUI

I am trying to refresh the Standard UI of the Record Page on Click of button. @wire(getRecord, { recordId: '$recordId', layoutTypes: ['Full'], modes: ['View'] }) wiredOpportunity; @api ...
2
votes
1answer
151 views

LWC renderedCallback not retrieving a wired record

I have a Lightning web component that is being called from a quick action custom button from a custom object record page. When the component is loaded, I need to retrieve the record so I can get a ...
1
vote
1answer
156 views

LWC - Local Development

Any updates about the Local dev server which was suppose to be out in beta probably this month based on the recorded webinar session I saw https://developer.salesforce.com/event/local-development-...
1
vote
1answer
68 views

Lwc Wired method result is not in proper format

I have below script in .js file. @wire(getRecord, { recordId: '$recordId', fields: FIELDS }) wiredSandAnalysis({ error, data }) { if (data) { this.yValues = []; data.fields....
2
votes
2answers
84 views

How to change wired data list after get data from imperative apex method

I have a variable 'contactList' wired to an apex method which will return a list of contact. There is another imperative method will return a list of contact filtered by 'Name' field. The contact ...
1
vote
1answer
70 views

LWC function calls - Apex Method Imperatively

import { LightningElement, track, api} from 'lwc'; import saveRecord from '@salesforce/apex/Controller.saveRecord'; export default class CreateModel extends LightningElement { @track showModal=...
1
vote
1answer
72 views

getRecord in connectCallback

I saw the following example of getting record : import { LightningElement, api, wire } from 'lwc'; import { getRecord } from 'lightning/uiRecordApi'; const FIELDS = [ 'Contact.Name', '...
2
votes
1answer
103 views

Using lazy-init pattern properties on Apex data objects in LWC

More of a technical question than a philosophical, because I am mainly interested in the intelligence of the LWC cache and any performance implications. I use the lazy-init pattern extensively in ...
1
vote
1answer
84 views

How to get field level help through wire in LWC

<lightning-helptext class="customIcon" content={helpText}></lightning-helptext> How to fetch help text of a specific field in JS as we do in apex/VF using $ObjectType....
1
vote
1answer
60 views

Null's check before calling wire service adapter

Is there any way to do a nulls check before calling @wire adapter (without refactoring callee)? We are seeing this odd exception bubble up from somewhere (even if we swallow errors). It appears ...
-1
votes
1answer
67 views

Issue with passing class data from apex to javascript in LWC [closed]

I am trying to return multiple values from the apex to javascript using wire decorator. Because of functions in apex cannot return multiple values at the same time, I am returning custom class ...
0
votes
1answer
132 views

How to override Save button and show the popup in lightning-record-form of LWC [closed]

I have the requirement to show a WARNING POPUP / confirmation box when user click on save button in Record form of Lightning Web Components(LWC). Can i override save button and display confirm popup ...
5
votes
2answers
208 views

lwc dataservice architecture best practices

While developing lwc components and lightning apps I always run into this design dilemma: When I have two children components that uses the same set of source data but in different forms what is the ...
3
votes
1answer
180 views

Use LWC @wire(getRecord) when recordId is not always present

I love how the LWC Wire Data Service reduces the amount of boilerplate code. I have a component which can be placed on Home AND Record pages. On Home pages there is no recordId and my call to @wire(...
7
votes
2answers
276 views

“Unable to read Sobject” when passing LWC getRecord data to Apex

I am using the LWC Data service to get query an Account already in the component via @track record; @wire(getRecord, { recordId: "$recordId", fields: ...}) setRecord({error, data}) { // Need to ...
1
vote
1answer
97 views

LWC: Share @wire between two components

What would be the best way to share @wire between two lightning web components? I went through this article but I figured that @wire is not going to work outside of a LWC. At least I couldn't trigger ...
4
votes
1answer
148 views

LWC component not rendering

I have a lightning web component that wires an apex method that calls out to JSONplaceholder.com to get back some data. I'm having issue with the whole component rendering at all. While in community ...
1
vote
1answer
99 views

Apex method not getting invoked in LWC

LWC JS: import { LightningElement, api, wire, track } from 'lwc'; import getAccDetails from '@salesforce/apex/UI_Controller.getAccountName'; export default class AccordionComp extends ...
0
votes
1answer
133 views

Lightning Web Component not loading while using Lightning-Input with Wrapper class variable

I am trying to build a simple Lightning Web component to allow capturing both parent and child record details on single form. To explain i am taking an example of capturings single Account and Contact ...
1
vote
2answers
204 views

Accessing single element of List from Apex in LWC

I have an apex which return list of Account and related Contacts to it. Now that I KNOW how to iterate thru' list of account but I am interested in 1st element of the list.So,I am trying to display ...
0
votes
2answers
173 views

Display Exception message in toast when calling Apex using @wire

I love @wire(ing) LWC properties like import { LightningElement, wire } from "lwc"; import getAccounts from "@salesforce/apex/MyCtrl.getAccounts"; export default class MyComponent extends ...
3
votes
2answers
114 views

LWC: wire apex to property with @api param value

Is there a way to get result from apex method if param is @api value (that comes from parent)? like this: @api trip; // comes from parent @wire(getTickets, { recordId: '$trip.Id' }) tickets; or how ...
0
votes
2answers
731 views

LWC: wire and getRecord, get field values

It's crazy. I'm gonna crash the table. How to show variable {name} ? Iterated component html: <template> <p>{idx} </p> </template> Properly shows: But When i try to add ...
0
votes
1answer
229 views

LWC / Get fields values with getRecord and wire

I can't get fields values with getRecord adapter. Component shows passed recordId only. Where is the problem? Parent HTML: <template> <lightning-card title="My Trips"> ...
1
vote
3answers
507 views

Callback function in LWC

I have 2 picklist(Combo-box). On change of value in the 1st combobox - depending on the value returned from the controller - i need to render or hide the 2nd combobox. I'm using refreshapex to get the ...
1
vote
1answer
193 views

Renaming LWC const variable breaks component behavior

I was surprised to find that changing the variable name for a JS const from fields to CONTACT_FIELDS caused my component to stop functioning. (I realize this is a naming convention for Java constants, ...
0
votes
1answer
293 views

Data not returned by wire service

I am unable to get data using getRecord method if wired to a function. The same call work when it is wired to property. I have given the code below. When wired to function, error and data (in ...
0
votes
0answers
91 views

LWC: getPicklistValues wire adapter

I want to call getPicklistValues wire adapter method from another method, as I want to show/load the picklist values on complete of another function. But wire methods can be called on page load and ...
1
vote
1answer
94 views

Does LWC @wire works with custom classes?

I'm trying to use @wire with a method that returns a list of my custom wrapper class. The list is returned, but the items have no fields. When I'm using @wire with List of SObject, everything is fine.
2
votes
1answer
378 views

How to avoid error Cannot read property of undefined using two LWC Wired properties

How to avoid error Cannot read property of undefined using LWC Wired properties but to display two properties? afterRender threw an error in 'c:tryc' [Cannot read property 'x' of undefined] HTML file ...
0
votes
0answers
52 views

Lightning Web Components - track user (insert visit record) after login

We use lightning communities. I am working on building a new LWC component, where I can place it in the page footer. The goal of the component is simple: once the user logs in, visits a page in the ...
0
votes
0answers
42 views

How to Pass record id from community page to another?

I am using navigation mixin for navigating to a community page from other community page- this[NavigationMixin.Navigate]({ type: 'standard__namedPage', attributes: { ...