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
2answers
40 views

Prepopulate values in lightning record form lwc

I’m trying to create one lwc component, where I need to prepopulate some values including lookup in lightning-record-form. Is it possible to do this in lwc?
0
votes
0answers
26 views

how to re-render lightning web component when some fields changed in standard form

I created a lwc component which will use phone number of the contact page. This form is placed in the contact detailed page. If the number is edited in the contact standard form, the value in the ...
2
votes
1answer
31 views

LWC picklist value undefined on initial load

I have a lightning-input-field inside a lightning-record-edit-form, used to create records. The field-name is a picklist field which uses a Picklist Value Set, with one default value. When the form ...
1
vote
2answers
64 views

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

I am trying to get metadata info for a custom object using lightning/uiObjectInfoAPI’ here is what I am doing: wire(getObjectInfo, { objectApiName: BATCH_OBJECT }) getBatchObjectInfo({data,error}...
0
votes
1answer
26 views

How to Populate default values in lightning-record-edit-form?

A button resides in a parent object, by clicking which a modal pops up with form to create a new case. Here I am using lightning-record-edit-form for creating a new record. How to pre populate the ...
2
votes
0answers
52 views

Record ID and Target Config Property value are setting to 'undefined' on lwc record page after spring'20 upgrade

I have lwc component built few months ago place on record pages, was working perfectly fine (and still works with winter'20 orgs). But started breaking on spring'20 sandbox and spring'20 scratch-orgs. ...
0
votes
1answer
42 views

LWC - Updating Record with Imported Schema

I'm wondering if I am doing this correctly. I'm trying to use the static schema for referential integrity as recommended here, under Import References to Salesforce Objects and Fields, but it doesn't ...
4
votes
0answers
51 views

LWC @wire order of execution not working for ie11

I have implemented a lightning web component (lwc) that shows a dependent picklist field To load a dependent picklist in lwc I use @wire with getPicklistValues and because getPicklistValues requires ...
9
votes
1answer
149 views

Get Object Label from API Name in LWC using wire

Is there any way to get Object label from API Name? I tried Below, but it gives API Name Only import objectName from '@salesforce/schema/object';
4
votes
2answers
60 views

How to @wire an external Rest API call with LWC OSS?

I have created a basic project and simply want to pull a list of greetings from Google Firestore instead of using the default static array of greetings. My greeting.js file looks like this: import { ...
0
votes
1answer
29 views

LWC Get Contact Name for current User (Community User) using wire and importing reference via relationship

I'm trying to get the First Name of the Contact related to the logged-in user. In this answer have been able to get the contact ID but when I try to import a reference to a field via a relationship ...
2
votes
0answers
39 views

Local LWC - Proxy Issue

Just getting into LWC and local development, so bear with me. Are there local LWC development proxy settings? I have been looking for a bit, but can't find anything. Basically, I'm getting the ...
0
votes
1answer
48 views

Date range query from lwc to Apex

I have this method getFarmData being called from LWC @AuraEnabled(cacheable=true) public static List<RecordWrapper> getFarmData(String listView, Integer Count) { if (...
4
votes
0answers
133 views

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 ...
0
votes
1answer
68 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
36 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
259 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
430 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
43 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
41 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
161 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
128 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
169 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
29 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
34 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
69 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
137 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
40 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
228 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
56 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
466 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
193 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
61 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
95 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
514 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
898 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
259 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
135 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
108 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
130 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
527 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
235 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
154 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
241 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
157 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
142 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
239 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
161 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
87 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
179 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 ...