Questions tagged [lwc-wire-adapter]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
31 views
+50

lwc getFieldValue from a custom external object

I am creating a LWC that handles data from an external object. I have access to the recordId through @api recordId;, but I need to get the externalId from this object as well. Currently, I have call ...
-1
votes
0answers
32 views

How to get values dynamically from Apex in LWC and update the report [closed]

I have a requirement to create a report, which consists of 3 dependent custom picklists. Picklist values are Sobjects records, chcnging one dropdown should change the values of another dropdown as ...
0
votes
1answer
44 views

Refresh Apex not working on Lightning Record Form Save [duplicate]

I'm not able to understand how refreshApex works in LWC. Here is what i'm trying to achieve: On a web component show - Show most recent 10 records of Account a form (I used a lightning record form ...
0
votes
2answers
35 views

Does the getRecordUi support Location Object?

I have a lwc component, In order to show WorkORder details page I need a relatedField on a relatedObject wich is Location.Name. I have used two methods import LOCATION_NAME_FIELD from "@salesforce/...
1
vote
1answer
91 views

Error: Refresh failed because resolved configuration is not available

I am trying to clear the cache of my wire method. But I have added refreshApex in my code but I am getting error Error: Refresh failed because resolved configuration is not available. My Code ...
6
votes
2answers
228 views

LWC : Events - When to use event.target.value & event.detail.value [closed]

I am looking for the difference between event.target.value and event.detail.value. It was mention that To communicate data to elements in the same shadow tree, use event.target and To communicate ...
1
vote
0answers
33 views

Use wire service/getObjectInfo with External Objects?

I'm am trying to use Salesforce's wire service to return schema information for an external object. js: import { LightningElement, track, wire, api } from 'lwc'; import { CurrentPageReference } from ...
1
vote
0answers
33 views

how to pass field value to track variables in lwc and retrive the track variable in a function

Hello I want to pass the IsConverted value into a variable and retrieve it in a function import { LightningElement,track,api,wire} from 'lwc'; import { getRecord } from 'lightning/uiRecordApi'; ...
1
vote
1answer
91 views

LWC: Can't access field values from @wire + uiRecordApi/getRecord

I'm new to LWC. And after going through the entire "Build Lightning Web Components" trail, I must still be missing something fundamental about how the uiRecordApi getRecord method works, or maybe I ...
0
votes
3answers
100 views

LWC wire function

I want to display some value using button click. I have written a simple js and apex. I don't see any error in console but the data is not displaying. Can anyone tell me what is wrong with my code. ...
4
votes
1answer
130 views

Mocking CurrentPageReference wire in Jest unit tests - LWC

I have a LWC component which uses CurrentPageReference from lightning/navigation bundle in a @wire function. I am using lwc-jest to create unit tests for my components. Using the wire with ...
0
votes
0answers
27 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
33 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
53 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
vote
1answer
87 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
33 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
155 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
46 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 ...
5
votes
2answers
363 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
137 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
47 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
68 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
342 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
629 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
172 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
90 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
75 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 ...
1
vote
1answer
116 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
357 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 ...
2
votes
1answer
222 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
123 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
167 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
106 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
108 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
177 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
136 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
75 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
136 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
272 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 ...
6
votes
2answers
343 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 ...
4
votes
1answer
315 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
3answers
363 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
208 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
252 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
175 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
230 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
537 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
291 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 ...
4
votes
2answers
198 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 ...
1
vote
2answers
1k 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 ...