Questions tagged [lwc-wire-adapter]
The lwc-wire-adapter tag has no usage guidance, but it has a tag wiki.
452
questions
0
votes
1
answer
1k
views
Fetching related record data and updating them using LWC
My objective is to build a LWC component which will display the list of related opportunity records based on account and also enable users to update the stage and amount fields. I am getting the child ...
0
votes
1
answer
2k
views
How to update multiple fields with one click in LWC?
I am tasked with creating an LWC that will update five fields on the Account object. The LWC only needs to contain one simple button with a heading. The button needs to be displayed only if certain ...
0
votes
2
answers
992
views
LWC wire adapter fields null error
import PARTICIPANT_FIELD from '@salesforce/schema/User.Contact.Active_Participant__c';
// LWC Code
@wire(getRecord, { recordId: USER_ID, fields: [PARTICIPANT_FIELD] })
wiredUser({ error, data }) {
...
0
votes
1
answer
33
views
How can I Jest test an Lightning Web Componet which leverages `connectedCallback`?
I have a Lightning Web Component "dapUserList".
This is the HTML:
<template>
<lightning-card title="User List" icon-name="utility:user">
<c-...
0
votes
1
answer
1k
views
wire function is not executing all time
I am trying to get some apex data when component is loading. For this I have added my logic into two different wire adapter inside the JS. but the 2nd wire function is not getting executed always. if ...
1
vote
1
answer
28
views
How to use dependent data from wired methods in LWC?
I have two @wired methods - how can I calculate a value in one method and then use it in the second method? I know everything is reactive - so I'm sure this is a somewhat stupid question but I just ...
2
votes
1
answer
48
views
Can I have an empty default LWC property with @wire?
In my LWC component, I have a property for the user without a default value:
<property name="type" type="String" label="Account Type"/>
I want the user to be able ...
1
vote
1
answer
840
views
Can't pass null arguments in wired function
In my LWC I have a few @api properties that are wired to a function that returns data from an Apex controller. However, one of these would be null be default. It seems that, as long as this property ...
1
vote
0
answers
36
views
How to use LWC to capture opportunity data and create new opportunity with modified data
I am using Quick Action on Opportunity record to create an LWC to edit Opportunity record and create a new record. I am unable to display the data on template.Here is my JS of Record Edit Form LWC
...
1
vote
1
answer
21
views
Trying to pass field value from controller into iframe on LWC
Trying to pass Opportunity.AccountId into the url string in an iframe on a lightning web component that I want to sit on opportunity record lightning pages.
I'm new to coding so trying to use this as ...
1
vote
1
answer
186
views
recordId is blank in imperative call
I have an lwc action button that loads the popup. When i load the component for first time, recordId is present. But when i close and open it again(without reloading the whole page), recordId is lost. ...
0
votes
2
answers
35
views
When are wired calls made?
Consider a simple LWC component that has searchRadius as a property:
<targetConfigs>
<targetConfig targets="lightning__RecordPage">
<property name=&...
0
votes
1
answer
900
views
How to get value from Case.Account.Primary_Email__c and Case.ContactEmail from case recordID and autopopulated in To field on email page in lwc?
Controller_consumerSendEmail.cls
public with sharing class Controller_consumerSendEmail {
@AuraEnabled(cacheable=true)
public static void sendEmailToController(String toSend, String subject){
...
1
vote
2
answers
106
views
Error handling using @wire
Let's consider a simple @wire example:
@wire(getRecord, { recordId: '$recordId', fields: RECORD_FIELDS })
wiredRecord({ error, data }) {
if (data) {
doStuff();
} else if (error) {
...
1
vote
1
answer
1k
views
Lightning Web Components - I am having problems getting the PicklistValues for the Status field in the Campaign object
I have the following code
import { LightningElement, wire, track } from "lwc";
import { getObjectInfo, getPicklistValues } from "lightning/uiObjectInfoApi";
import ...
3
votes
2
answers
148
views
Imperative Call Using Await In LWC
Is it possible to imperatively call a function from a wired function using async/await? And yes, I've seen similar questions - but they kinda miss the point I'm trying to make.
Consider this simple ...
4
votes
1
answer
22k
views
Unable to pass parameters to wired property in LWC
Unable to pass parameters to wired property in LWC.
I have a standalone app
<aura:application extends="force.slds">
<c:abc a="a" b="a,b,c" c="c&...
2
votes
1
answer
147
views
Fetching data in LWC via getRecord vs. Apex
I don't know how to ask this question properly - so please bear with me.
Let's say I query an account via getRecord:
@wire(getRecord, { recordId: '$recordId', fields: ['Account.Id', 'Account.Name'] })
...
5
votes
1
answer
2k
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
0
answers
38
views
Not able to fetch the record from salesforce history using LWC
I am new to LWC. I have this picklist field in the custom object. So this is the apex method that is exposed to lwc.
@AuraEnabled(cacheable=true)
public static String getPriorStatus(String ...
-1
votes
1
answer
67
views
How to wait for changes to field and update UI
In LWC js, a json content is updated(appended) in long text field on a record. Each update needs to be captured as a UI row with those details. So, initially we would see 1 row, keep checking the same ...
0
votes
0
answers
77
views
Record ID of lead is not coming in wired property LWC
I'm using below code for creating LWC path for lead. In getRecord method I'm trying to fetch the lead record which is just loaded. I'm using below code
import { LightningElement, api, wire, track } ...
1
vote
1
answer
101
views
How to show dependent picklist based on controlling field in Lightning data table
My component showing Controlling picklist and dependent picklist values as expected. But when i edit Controlling picklist then dependent picklist showing all values not related to the Controlling ...
2
votes
2
answers
3k
views
Child component not refreshing when updating data from Parent Component
I am using a util lwc data table and passing list of records from the parent component, I am using a refresh button to re-fetch the records from Apex (imperatively) and update the LWC data table but ...
0
votes
0
answers
42
views
GraphQL Semi join : Filter condition on semi join query gives error for 2 specific fields
const whereClause = `where: {
Id: { inq: {
Apttus_Config2__AssetLineItem__c : { and : [
{ Apttus_Config2__AssetStatus__c : { eq : "Activated" } ...
2
votes
1
answer
1k
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 ...
2
votes
1
answer
53
views
Inner class string passed to LWC being cut off
I have a custom lwc development that gets a configuration object from the backend via @wire decorator that is cutting off one of the response properties.
{
"cascadeMode": true,
"...
0
votes
1
answer
2k
views
Chart JS is not loading in LWC
I am trying to display a bar chart using chartJS in LWC. On the page load the chart bar doesn't appear. If i do inspect element then it appear. Below is the code -
JS -
@wire( getOpportunities ) ...
3
votes
2
answers
4k
views
Assert Violation: Invalid template iteration for value Error in LWC template
I am trying to return a list of users through a search box to be used in a distributed marketing implementation.
I have a container component that houses the search box component and the iteration ...
0
votes
2
answers
2k
views
Get current record's parent records and display a list of records in LWC
Account Product looks up to Account. I want to get account id from current account product and pass it to my controller and return a query using the account id. I am trying to achieve this with LWC. I ...
3
votes
2
answers
2k
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
1
answer
86
views
Call apex method from LWC with parameters after record creation
I am inserting data to a custom object through LWC. I want to call an apex method from the JS with the Id of the newly created record and current user's email address.
Apex Method:
@AuraEnabled(...
0
votes
0
answers
33
views
Why LWC component is reloading due to the recordtypeId is changed in Record Edit Form
My LWC component has lightning-record-edit-form, and it is working fine in normal scenario. But whenever there is an update in recordtypeId field, it reloads the whole page.
things I already checked:
...
0
votes
1
answer
1k
views
Populate input field with data LWC
Hello everybody I am currently working on a Flow that receives the Id from the record where the LWC action is and pass it to the LWC.
The LWC is a form that shows some lightning-input and lightning-...
13
votes
5
answers
6k
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 ...
0
votes
0
answers
50
views
@wire getting called automatically when switching between tabs in Lightning Console
I see a very weird behaviour, in which the @wire is being called every time, I switch between tabs after 30 seconds. (Lighting console tab)
Here is the code:
@api recordId;
@wire(getRecord, {...
0
votes
1
answer
2k
views
lwc use a wired variable in an invoke method
I have the requirement to get a list of field values for a specific account and use the values to navigate to the new contact screen via lwc. My js code is like this :
import { LightningElement,...
14
votes
3
answers
11k
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
1
answer
84
views
Picklist value is not displaying using @wire in LWC for a specific user
{"status":403,"body":{"message":"You don't have access to this record. Ask your administrator for help or to request access.","statusCode":403,"...
1
vote
1
answer
159
views
getObjectInfo/getPicklistValues permissions needed in public community
What are the permissions needed to use getObjectInfo (needed for default record type) && getPicklistValues wire adapters in public community?
I've added but I'm getting 401 when accessing ...
0
votes
1
answer
782
views
Datatable won't refresh data on button click event
I am quite new to LWC, i've created a component that would paginate through a data table. The data table loads correctly from the wire method on component load. problem is when I click Next button, ...
1
vote
1
answer
2k
views
LWC @wire - [Cannot read properties of null (reading 'fields')]
I have followed the documentation but don't understand why I receive the following error in experience builder for my component:
LWC component's @wire target property or method threw an error during ...
0
votes
1
answer
81
views
Lightning progress indicator does not render correctly
I'm creating a custom path for the Case Status field to use in a Community page. The Status values are dynamically populated since different Record Types have different Statuses. My problem is that ...
1
vote
2
answers
1k
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
1
answer
2k
views
Conditional Rendering of a Form Based on Case Status LWC (if:true)
I am trying to get a form to render conditionally based on the Status value of a case (don't ask me why I'm doing this just trying to learn about attributes, @wire, etc.). Any help would be ...
0
votes
1
answer
133
views
How to call a method that makes DML and after that another method to get data and cache it
I have a LWC component, I want to get data of page-layout assigned to user's profile and the fields in the layout. For custom profiles they won't have 'View setup' permission which is needed to get ...
1
vote
1
answer
468
views
notifyRecordUpdateAvailable vs RefreshApex vs RefreshView API
RefreshApex works for me so far in almost every case. I'd like to understand why I would instead use notifyRecordUpdateAvailable or the RefreshView API instead. Or am I horribly misunderstanding the ...
-2
votes
2
answers
146
views
Use of more than 1 reactive parameter in wired method
I am trying to create a reusable component to fetch picklist values of a specific field dynamically on a record page.
The field API name can be configured in the record page.
Updated
I am trying to ...
3
votes
3
answers
3k
views
How to access the specific element from List<String> in HTML <template> file directly in LWC?
It is ok to retrieve the elements of a List<String> in Javascript controller in LWC as below:
@wire(getListOfString)wrappers({error, data}) {
if(data){
this.stringList = data;
this....
0
votes
1
answer
425
views
How can I refresh a child component from its grandparent?
I have LWC 3 components, grandparent, parent, child. grandparent should get records of Assignment__c. For each Assignment__c, we display a parent instance. parent gets records of Timecard__c and for ...