Skip to main content

Questions tagged [wire]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
57 views

LWC component to search Account records not displaying data

I'm new to LWC and trying to build a basic component to display account records based on the search term entered but it is not displaying the data even though data is retrieved from Apex. Apex Code: ...
coder123's user avatar
  • 129
0 votes
0 answers
56 views

Need Help with Importing Salesforce Schema for Custom Fields

I've created a custom picklist called Discount_Type__c within the Opportunity Product object. Despite using the appropriate schema import statements in my JavaScript code, I'm encountering ...
Sridhar's user avatar
  • 61
0 votes
1 answer
142 views

Picklist values are not showing in the LWC Datatable

Here I'm creating custom type Datatable here which extends standard LWC Datatable. Also, creating an extra HTML file customPickList.html, customPickListEdit.html so we can put the Picklist Combobox ...
Sridhar's user avatar
  • 61
0 votes
1 answer
252 views

Is there a way to manually refresh lightning-record-picker query results?

I am trying to use lightning-record-picker to obtain records of ServiceAppointment object. Records need to be filtered by by list of ids that are obtained from Apex method that is called as soon as ...
dobra_wodka's user avatar
0 votes
0 answers
24 views

Result of the APEX method is empty outside experience builder

I'm using the following method to query articles from the Knowledge__kav object. It returns the values properly inside the community Experience builder. However when it comes to the normal page it ...
ledmatrix's user avatar
0 votes
1 answer
84 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,849
1 vote
1 answer
146 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
108 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
68 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
300 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
187 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
281 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
254 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
292 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
242 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
118 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
221 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
122 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
82 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
1k 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
  • 925
2 votes
1 answer
3k 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,849
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,841
1 vote
1 answer
2k 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,849
0 votes
2 answers
449 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,707
-2 votes
1 answer
316 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
590 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
440 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
  • 61
0 votes
2 answers
491 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
2k 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
209 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
82 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
178 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
613 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
69 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
785 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
605 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,948
1 vote
0 answers
883 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
  • 63
1 vote
1 answer
1k 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
424 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
882 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
189 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
  • 435
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
1k 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
4k 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
1k 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
  • 609
0 votes
0 answers
703 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 ...
Jonathan's user avatar