Questions tagged [wire]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
38 views

LWC Object.assign dot notation throwing error - need to use name field in datatable

I am using a datatable in a custom listview LWC component and need to display the lookup fields as urls. I'm trying to flatten the results in order to use the dot notation for a lookup on the Account ...
Irene's user avatar
  • 1,769
1 vote
1 answer
50 views

Date Field Operator in "where" parameter of @wire LWC

Introduction I am trying to use the "where" parameter provided by the "getRelatedListRecords" of "uiRelatedListApi" within @wire in LWC (reference 1). Specifically, I am ...
yanaspaula's user avatar
2 votes
1 answer
73 views

Wired List not Refreshing when LWC Record Page is updated by Flow

I am using a Custom LWC on the record page of my Custom Object. In my LWC I have a wired list of Related Records which I am using in a datatable. I have a Screen Flow on the record page makes a call ...
Jeff Callahan's user avatar
-2 votes
3 answers
65 views

This error occurred while I am trying to execute this code

Apex Class: public class updaterec { @AuraEnabled(cacheable=true) public static void updateContact(String recordId, String firstName, String lastName) { Contact contactToUpdate=[Select ...
Sundi Chaithanya Reddy's user avatar
0 votes
0 answers
177 views

getrelatedlistrecords is not getting refreshed

@wire(getRelatedListRecords, { parentRecordId: '$recordId', relatedListId: 'Histories', fields: '$fieldHistory', }) wiredFieldHistory({data, error}){ if (data) {...
shruti rawat's user avatar
1 vote
1 answer
120 views

Hide Spinner on LWC load with multiple wire methods

I have created a LWC which is called from quick action. The component has multiple wire methods that retrieves data from the record (field values, picklist values and so on) once the component is ...
Omnia's user avatar
  • 191
-2 votes
1 answer
165 views

How to refresh lightning web components data when apex updates data?

I am updating my lead data from a Queueable apex class, because I have to wait for an api response to come back with some data. In the same time I am displaying the data that the apex class updates on ...
Ábel's user avatar
  • 11
0 votes
0 answers
93 views

refreshApex() is refreshing the data but is not invoking the function decorated with wire

An LWC component uses wire service to make a callout to an external system during page load. Users are able to refresh the data by clicking the Refresh button on the UI, which invokes handleRefresh(). ...
Akif's user avatar
  • 15
0 votes
1 answer
131 views

How can I display @wire iteration data in LWC component

I am training in LWC, and am attempting to display wired data in an iteration 'template' element. The data shows up in my browser console, and I can also get a 'test' string to show up for each of the ...
David Scott's user avatar
1 vote
1 answer
165 views

LWC - Is there anyway I can push value from 2 @wire into 1 array

I have 2 @wire Apex methods that will invoke code from Apex Controller. Right now the array only has value from the 1st wire (because it get called first) but not the 2nd one. My question is: How can ...
Pam's user avatar
  • 107
0 votes
1 answer
86 views

Picklist values from different object not retrieving

I am trying to fetch two picklist values from two different objects but I am only able to get one field from either of the object. Not sure if there is any limitation that only one object field can be ...
Sam-dev-sfdc's user avatar
0 votes
2 answers
89 views

LWC component which fetches data via apex not visible when site published

So there's a News reminder Component in my website and from Apex class method the records from Member object are fetched and displayed on cards. The functionality works fine in LWC Builder but when i ...
MOUSIN MULANI's user avatar
-1 votes
1 answer
71 views

Empty LWC datatable after adding infinite loading

Can somebody take a look why my LWC datatable is empty after adding infinite scrolling? I feel that is small bug inside my code, but I am not sure where is it.. JS: //SHOW WORK ORDER RELATED ...
ApexNewbie's user avatar
0 votes
1 answer
59 views

Get method returns undefined value in loc, using getRecord @wire adapter

I have an issue with proper passing of the value, getting undefined errors. Would appreciate any input. Parent Componen import { LightningElement, api, wire } from 'lwc'; import { getFieldValue, ...
MatejN's user avatar
  • 31
0 votes
2 answers
687 views

Show/hide spinner every time @wire is called

I have a lwc with multiple wires that retrieve information and I need to display a spinner while all this calls are being made and hide it whenever they finish. I've seen that you can do this wiring ...
molinet's user avatar
  • 915
1 vote
1 answer
2k views

LWC get field value from @wire result (single object) from apex query

I've searched for an answer but found none. The answer is probably simple, but I'm tired of trying and not finding a solution! I need to access the fields returned from the query. It does not return ...
Irene's user avatar
  • 1,769
0 votes
0 answers
23 views

LWC - Wire pass dynamic ids to get records method [duplicate]

In LWC js i am trying to dynamically pass the ids for getting records of a object. if i hard code records id like this it works recordIds: ['0687h000002Jim0AAC','0687h000002Jim5AAC'], but if try ...
RedDevil's user avatar
  • 7,803
1 vote
1 answer
1k views

LWC conditional check in for:each on field content

I have an LWC in which I need to check the value of a field in a for:each loop to determine what to display in the HTML. I've tried to find a solution but haven't had success so am hoping someone will ...
Irene's user avatar
  • 1,769
0 votes
2 answers
283 views

How to process <String, customwrapper class> in LWC js file

I have the below apex method returning the below Map @AuraEnabled(cacheable=true) public static Map<String, AccountDtls> getActiveLstng(Id accountId ){ <<code returning the map>> } ...
user5352's user avatar
  • 1,665
-2 votes
1 answer
212 views

Calling apex with multiple parameter where the parameter is coming from input field

I have a apex class public static List<Customer_information__c> gettingRecords(String detail, Date starti, Date endi, String comboData) And i am wiring this from js @wire(gettingRecords,{detail:...
Aditya's user avatar
  • 1
1 vote
1 answer
438 views

I'm trying to call method Imperatively based on the wired result but not getting result

I have one LWC component. In my JS file, I'm trying to call one apex method imperatively as it is not cache enabled, based on the result of wired method. I'm not receiving the result of my wired ...
salesforce Developer's user avatar
2 votes
1 answer
283 views

Can't dynamically fetch currency in a LWC when pulling from a wired Apex method

I am new at LWC and trying to do something I thought was fairly simple, basically just using apex methods to query data, wiring them in javascript, building out an array of information, and passing ...
Chris's user avatar
  • 51
0 votes
2 answers
432 views

How to pass an value of lightning-input-address to apex class?

I'm trying to find Opportunity records with an address within X amount of miles from an entered location. I'm using the lightning-input-address and passing the value to an Apex class and am getting ...
Luke Higgins's user avatar
0 votes
1 answer
1k views

FullCalendar Rendering Error "fullCalendar is not a function"

We are using FullCalendar.io version 3 for Salesforce LWC component. Time by time, we are facing the rendering issues and instead of calendar rendering we see the error message LWC component's @wire ...
Svanskey's user avatar
3 votes
1 answer
150 views

Two Wires to same service confusing emits in Jest

I have this in an LWC: import {getObjectInfo} from 'lightning/uiObjectInfoApi'; @wire(getObjectInfo, { objectApiName: 'My_First_Object__c' }) receiveMyFirstInfo({error, data}) { if (data) { ...
Colin Steel's user avatar
0 votes
1 answer
70 views

Hyperlinks are missing after using Search bar - LWC Datatable

The whole datatable looks fine, and hyperlinks are visible till using Search Bar. After writing dummy words - the data is showing correct, but without hyperlinks. What I missed? I need to refresh ...
ApexNewbie's user avatar
1 vote
0 answers
152 views

Certain fields (spanning across object relationship) displayed as blank in lightning-datatable

We have a custom object called a "Plan" (API NAME: Plan__c). Plans have rather complex relationships with contacts. In order to account for the complexity of the relationships, we have a ...
ZJC's user avatar
  • 11
0 votes
1 answer
446 views

I am new to LWC and stuck badly in getting the old field values

if (data) { this.account = data; let modifiedDate= this.account.lastModifiedDate; let oldValueRate= getFieldValue(this.account, RATING_FIELD) ?getFieldValue(this.account, ...
mike's user avatar
  • 13
0 votes
0 answers
54 views

LWC value comparison not working

I want to compare old and new values in LWC. I want to show alert message when Account Rating field value changes to hot. if (modifiedDate != this.lastModifiedDate || modifiedDate == this....
mike's user avatar
  • 13
1 vote
1 answer
646 views

I am new to LWC. I dont want to show alert message every time i refresh account detail page

export default class ShowToast extends LightningElement { @api recordId; account; lastModifiedDate; createddate; check=true; @wire(getRecord, { recordId: '$recordId', fields: ...
mike's user avatar
  • 13
0 votes
1 answer
529 views

lwc wire decorator won't trigger when one of properties is set to undefined

So I am calling apex via wire decorator, and I am passing in 3 inputs. The accountId and contactId are dependent on other wire service getRecord, when I receive the data from getRecord and populate ...
Damecek's user avatar
  • 1,918
1 vote
0 answers
820 views

How can I refresh data on LWC which is received by Apex method imperatively?

I have written wire and if data is received successfully I am calling function in which apex method is called imperatively, so how can I refresh results of that apex call for example on button click ...
Nikolas's user avatar
  • 53
0 votes
1 answer
859 views

ILLEGAL_QUERY_PARAMETER_VALUE -- Expected '.' in all qualified names: RecordTypeId is invalid

Usecase is to get the picklist values according to the record type of the Record. selectedCaseId; caseRecordTypeId; wiredCaseRecordTypeId; @wire(getRecord, { recordId: "$selectedCaseId",...
Muskan Agarwal's user avatar
1 vote
1 answer
352 views

Wire Service Jest Test - Config Object Empty so filterFn not working properly

So, I followed: https://github.com/salesforce/wire-service-jest-util Testing LWC with multiple @wire getRecord calls with Jest to help get my test configuration setup for multiple @wire getRecord ...
adam's user avatar
  • 11
0 votes
1 answer
718 views

Conditionnaly wire data in LWC components based on context

Is there a good practice to conditionnaly get data from a component when this data can be passed by a parent? Eg: I have a component that relies on data which he can get through a wire call or through ...
Jurgen Palsma's user avatar
0 votes
1 answer
159 views

How to set missing elements from the result in LWC

If the following array is the result from the database as input to datatable in LWC. How can I set empty/missing elements which are empty (fields are optional)? Datatable is showing as empty because ...
Tomas Kocian's user avatar
3 votes
1 answer
3k views

LWC Wire Service - Firing Twice

Can someone explain to me if it is normal for the wire service to be called twice in the javascript below. The javascript is below and is added to the account record page. I am also posting a ...
Frank's user avatar
  • 411
6 votes
0 answers
2k views

How to refresh LWC component using getRelatedListRecords when related record edited

I have a component rendering a list of records related to the record on which the component is displayed using getRelatedListRecords (Beta). //Get Related List Records Info @wire(...
MooseAteJack's user avatar
1 vote
1 answer
3k views

Refresh query data in LWC every X seconds

I want to refresh my Apex every X seconds from my LWC component. I have a wired function in my component: initialized; wiredData; @wire(getChartData) chartData(result) { this.wiredData = result; ...
Josiah's user avatar
  • 153
0 votes
1 answer
1k views

LWC returns empty array from apex method

I'm trying to receive some data on the frontend using this Apex class (see below). The returned data however is an empty error. I followed the official SF documentation, made everything public and ...
M.E.Amrani's user avatar
-2 votes
1 answer
945 views

LWC @wire can not get apex return value

I'm not getting the success string below Apex @AuraEnabled public static string methodName(){ return 'success'; } LWC JS @wire(methodName) returnstr(result){ console.log('xxx = ' + ...
Jason Wang's user avatar
1 vote
1 answer
3k views

how to make a conditional wire

I need to know how I can make a @wire run when a condition is met, in this case it is selecting 2 values ​​from a combobox list and displaying a combobox list. I store the values ​​in variables to ...
DDCruz's user avatar
  • 21
0 votes
2 answers
3k views

Execute one of Wire methods before other LWC

I have five wire methods in my LWC. And I want to execute one of them at first. And only if this one is successfful - execute others. Is there any way to tell my LWC Which wire method I want to ...
Vitalii Dehnerys's user avatar
3 votes
2 answers
927 views

Can I import the wire from lwc without having to extend LightningElement

Am I allowed to use the wire service in an ES module, i.e. a 'headless' utility class? Or, must I extend LightningElement also? import {wire} from 'lwc'; import sapLogin from '@salesforce/apex/...
bkwdesign's user avatar
  • 581
0 votes
0 answers
621 views

404 error when moving LWC to Community

So I have made an LWC which is working perfectly on a test App page. Now I have changed the metadata and added in some code to pull a variable from the url so that it can be used in a community. I ...
NewToThis's user avatar
0 votes
0 answers
1k views

LWC Apex Refresh not working

I have been struggling to understand why my HTML is not rendering Fresh Stream of Data using Apex Refresh. I've used the cacheable method in Apex. @AuraEnabled(cacheable = true) public static ...
wink's user avatar
  • 17
0 votes
2 answers
4k views

Reference wire getter value as Javascript variable in LWC

This seems like it should be really simple but I am finding it impossible to get wire field values into a variable I can then use within the Javascript code (such as concatenating them into a String ...
NewToThis's user avatar
0 votes
1 answer
842 views

How to insert field value and ID to dual list box from APEX controller

I am making a Lightning Web Component and for it I want to populate a dual list box with a list of records, with the value of one field being the label and the ID of the record as the value. I am ...
NewToThis's user avatar
2 votes
2 answers
2k views

LWC - apex refresh of data table from data retrieved using @wire

I have a lighting web component datatable that is populated from and @wire call. Below are the key snippets from my code import { LightningElement, api, wire, track } from 'lwc'; import ...
Amul Shah's user avatar
  • 133
0 votes
1 answer
335 views

Calling Apex Methods in React? (Not using LCC - because it seems outdated)

Hello – in referencing https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.apex_wire_method Is there a way to reference apex functions directly in a React component. I ...
Nour's user avatar
  • 1