Questions tagged [wire]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
1answer
24 views

LWC wired service getRecord won't rerender with reactive property

I am trying to use wire service to get the geo data from a record, and expecting the component will rerender every time wire service gets the data. This is how my component JS looks like, import ...
1
vote
0answers
51 views

LWC: Assertion error when testing @wire chain in Jest

I am trying to write Jest test for a component with two @wired calls (both bound to functions), but I get assertion error about property of second @wire call not being annotated with wire annotation. ...
0
votes
2answers
40 views

Call the function if there is values returned by the wire method

I have a function in LWC which is getting invoked if Wire brings some values from Apex. but issue here i am facing is function is still getting called when data=[] Logic : Wire @wire(getRFCt, { crid: '...
7
votes
1answer
157 views

Chain Apex Methods in LWC

I am having a situation where I'm trying to pop an alert on an opportunity, but it's conditional based on data on the current user, and data on a custom object. I noticed that on refreshes the alert ...
2
votes
1answer
99 views

Using @api global variable showing undefined value in Salesforce Lwc in wire method

I am using global variable @api filter in wire method in child component. Defined this variable with default value="". I am passing value say 'xyz' to this filter parameter from parent lwc component. ...
0
votes
2answers
84 views

getRecord, getFieldValue always return undefined values in LWC

Here is the javascript code of my LWC import { LightningElement, api, wire, track } from 'lwc'; import { getRecord, getFieldValue } from 'lightning/uiRecordApi'; import getAlertMetadata from '@...
2
votes
1answer
138 views

LWC: Maximum Blob Size From JS To APEX

I want to make a "custom file upload" LWC component as I am in need to build a specific design for an upload process. There are a few things I am not sure about. What would be the maximum size of a ...
0
votes
1answer
50 views

Can you call getRecord or @wire from child component?

I'm trying to make a basic with the @wire method on the contact record to pull in a phone number. But the error I keep getting is Cannot read property 'fields' of undefined on c:ParentElement Cannot ...
0
votes
2answers
64 views

Cannot use an Id retreived by getFieldValue into @wire getRecord

I have an Account lookup field which gets Account ID, and need to get its Account Name on field change. (This is a Home tab component using Opportunity Form) HTML (lightning-record-edit-form; object-...
0
votes
1answer
44 views

Lightnig Web Component Wire

Hi I have set up a wire service which returns the data from the Apex side , in the Apex I have ABC__c as a field , how can i access the field in JS of LWC. Below is my code: @wire(ASD, { CFG: '$...
0
votes
1answer
87 views

LWC Wire null check in order to return null or an empty array

Hi I need help on of my req in which i want some fields from Salesforce server to display in the LWC component on the basis of it i want to show one message in the child component, If there is no ...
0
votes
1answer
24 views

can anyone help me,i can't see the output when fetching the data from object in a lwc

<template> <lightning-card title="AllContacts"> <ul> <template if:true={responseReceived}> <template for:each={contacts.data} for:...
0
votes
1answer
44 views

LWC Help changing field value to OldValue from Histories related object

I am having real trouble with a simple task. I have an object Contract__c and it has history tracking on. I need to button onclick revert the Contract_Status__c field back to its most previous ...
0
votes
2answers
74 views

LWC @wire change 'this' context

I have a problem with my code export default class PdmNewModalPlist extends LightningElement { @api objectName; @api fieldName; @api apiName; @api recordTypeId; @track obj; @...
0
votes
0answers
36 views

How to refresh the other lightning web components on a page when one component updates the data on a record-form?

I have actually 2 Lightning web components- 1.) lwcPropertyList 2.) lwcProperyDetail USECASE -> When I update any of the field on the record-from(present on lwcPropertyDetail), it is required that ...
0
votes
2answers
76 views

Why is does refreshApex need to return the method?

Given the below LWC JavaScript: import { LightningElement, wire } from "lwc"; import getRecords from '@salesforce/apex/MyController.getRecords'; import { refreshApex } from '@salesforce/apex'; ...
5
votes
1answer
76 views

Can an @AuraEnabled method be added in a managed package patch release?

I have a managed package with an LWC component. I need to enhance this LWC in a patch to allow it to receive some additional data during its initialization, which is done using an @wire. The data ...
1
vote
2answers
574 views

Concatenate two Values in a LWC (Lightning Web Component)

I am currently grabbing field values from a Lead and displaying them onto a LWC. I am having trouble taking two values and placing them into a variable. Here is my JS: // ********************* // ...
0
votes
3answers
160 views

LWC @wire parameter getting undefined

Hi All I declared objectName with value why I am getting objectName undefined, doinit of component // Public Property @api objectName = 'Account'; @api columns; @api relatedFieldAPI; @api ...
1
vote
1answer
249 views

LWC to display records grouped by RecordType Name

I'm trying to get a list of all CaseT records under their respective recordtype name in a lwc component. So, CaseT Recordtypename 1 CaseT A CaseT B CaseT C CaseT Recordtypename 2 CaseT X CaseT Y ...
2
votes
1answer
74 views

lwc wire server side changes not detected

I have a lwc component with apex service wired. This apex service takes an parameter. Since it is a wired service, I need to mark it as Cacheable=true on the apex controller. On the UI Wired service ...
1
vote
1answer
65 views

Reactive property in @wire notation from other @wired method

DISCLAIMER : I know there are better ways to get the current User Id, I am just writing this up as example to illustrate the issue I am facing. Let's say I have two apex methods that are @AuraEnabled ...
4
votes
1answer
510 views

Wired Apex Method not getting called on Load

I've a problem on a wired apex method not getting called from a Lightning Web Component on load. This web component is inside a parent Lightning Aura Component which has a date picker where today's ...
2
votes
1answer
183 views

Lwc getPicklistValues not working on OpportunityLineItem

I am trying to get picklist values for the field on OpportunityLineItem, but getting {}. import { LightningElement, wire } from 'lwc'; import { getPicklistValues } from 'lightning/uiObjectInfoApi'; ...
4
votes
1answer
142 views

lwc wired variable in refreshApex throws “resolved configuration is not available”

I have worked myself through several topics here on StackExchange already, finding this one to be the most helpful: working with the refreshApex feature in LWC However, the proposed solution does ...
0
votes
2answers
79 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
0answers
46 views

LWC: @wire No such column 'UserRoleId' on entity 'User'

I am getting this error when trying to do @wire for the current user. I assume that this is some sort of sharing issue. Is there a way to do something similar to without sharing for @wire so that I ...
3
votes
1answer
3k views

LWC: Does @AuraEnabled(cacheable=true) cache the result individually or combined?

Prequel: I have several methods in need of the same @wire operations. The approach I initially took was to make a new utilities component just for the wire operations and then use the pubsub library ...
1
vote
2answers
1k views

LWC Wiring apex method returns [object Object]

I'm trying to display the account of the logged in community user. Right now i'm only trying to display the Id but it's returning [object Object]. Maybe i'm not going about it the right way. Here is ...
4
votes
1answer
7k 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" /> </aura:application> and ...
3
votes
2answers
986 views

Lightning Web Component - Must provide at least one of the parameters - 'fields', 'layoutTypes', 'optionalFields'. Update Record

I'm trying to run a simple update action on a record that I queried initially using a wired method. After prepare the recordInput object I get this error: { "error": { "ok": false, "status":...