Questions tagged [lightning-data-service]

Questions relating to the Lightning Data Service. Lightning Data Service is a service provided by Salesforce to streamline data access in aura components and lightning web components.

Filter by
Sorted by
Tagged with
0 votes
0 answers
176 views

LWC unreliably refreshing cached data from wire service

I am building an LWC to be embedded on a record page that displays fields from multiple objects (not master-detail; related by lookup fields), calculates profit margins, and then dynamically adds a ...
mistere's user avatar
0 votes
1 answer
109 views

Record is updated successfully with "force:recordData" but in response getting Error status code as 'INSUFFICIENT_ACCESS'

In my Lightning component, I am using Force:recordData to update the record It is getting updated but throwing error. Any help would be greatly appreciated. Test.cmp code <force:recordData aura:id=&...
Anonymous's user avatar
1 vote
1 answer
955 views

Cannot read properties of null error while loading an aura component

We have an aura component that is included on the lightning record page. it shows warning messages on certain conditions. We are facing an error 'Cannot read properties of null(reading fieldname__c)' ...
Aditya Phadke's user avatar
2 votes
1 answer
251 views

The documentation reads 'Wire adapters and JS functions are built on top of LDS'. What is an adapter?

The documentation reads- Wire adapters and JavaScript functions in these modules are built on top of Lightning Data Service (LDS) and User Interface API. Use these wire adapters and functions to work ...
Gargi Gupta's user avatar
0 votes
1 answer
50 views

Are the Lightning Data Service types for Aura Components and LWC component different?

Do we have different LDS for AURA and LWC components?
Gargi Gupta's user avatar
1 vote
0 answers
165 views

Data caching with LDS

I would like to get clarification on how data caching works in LWC. So according to the documentation for LDS: Records loaded in Lightning Data Service are cached and shared across components. If a ...
FeeM's user avatar
  • 56
0 votes
1 answer
21 views

force:recordData gives unsupported entity error for a newly created Business Platform Object BoatReview

I want to use force:recordData component for BoatReview's addReview functionality. But I am getting this error "This entity is not currently supported by force:recordData." What else I need ...
Mahesh Nagarwal's user avatar
1 vote
1 answer
5k views

How do I call @wire(getRecord) from an event handler?

I'm creating an LWC component for Flow which contains a pill container of "recipients", and a lookup field to add recipients. I'm using lightning-record-edit-form and onsubmit to call a ...
ApexZombie's user avatar
0 votes
1 answer
2k views

Unable to create record through LWC

I have been trying to create an account record through LWC but I am unable to do so. Can anyone identify the issue here. Please find the code snippet below: Markup: <template> <lightning-...
code234's user avatar
  • 145
10 votes
2 answers
772 views

Has boxcar'ing for LWC's changed in the last 18 months?

The accepted answer here Boxcaring is removed from LWC components? contains important information about how requests to the server initiated from LWCs are grouped so browser limits on parallel ...
Keith C's user avatar
  • 134k
-3 votes
1 answer
44 views

anyone can give the solution [closed]

Failed to save lightningDataServices.cmp: No INTERFACE named markup://flexipage:availableForAllPages foundNo INTERFACE named markup://flexipage:availableForAllPages found: Source
Radha Krishna's user avatar
0 votes
2 answers
1k views

How to hide controlling field and how to pass values of controlling,dependent picklist fields to save record using Lightning record edit form - lwc

I have created a form using lightning record edit form which basically has few case object standard fields and a controlling and a dependent field. I was able to default the controlling field value in ...
Ajay's user avatar
  • 45
1 vote
1 answer
209 views

LWC: How to track wired properties' LDS activity

As I have written more LWC components, I've generally found that things work best when you stick with the reactive model as much as possible, and that by properly writing your getters to gracefully ...
Jason Clark's user avatar
  • 11.6k
0 votes
1 answer
2k views

How to track record's field value updates in LWC?

I have a component which I'd like to present the real-time value of my record's fields. Considering simplified getFieldValue(record, field) Docs Example: HTML: <template> <lightning-card ...
Przemysław Długoszewski-Tamoń's user avatar
0 votes
1 answer
2k views

How to rerender/refresh a lightning web component when a database change occurs

Requirement: I need an LWC on Case record lightning page which should listen to another table called customobj1__c and display just the most recent record in that table. When the most recent record in ...
codingislife's user avatar
0 votes
1 answer
265 views

show record view/edit form from quick action component

I am trying to show a Record View/Edit forms in a modal from lightning quick action component. In this quickaction component I am using lightning data table to show list of records and beside the ...
Akash's user avatar
  • 361
3 votes
1 answer
5k views

Add hyperlink to record page in lwc

I have a lightning web component that fetch account record from Salesforce. When a user clicks on the Account name, I want to take the user to the Account record page. How can I achieve this? .html &...
Ajmal Razeel's user avatar
2 votes
0 answers
804 views

Lookup search modal not working for lightning-input-field component in lightning out for LWC

As visible in the screenshot below, The lightning-input-field component along with lightning-record-edit-form is used to generate this view. LWC is embedded inside the Visualforce page using the ...
Akshay Poddar's user avatar
0 votes
1 answer
2k views

Can I use uiRecordApi getRecord to get dynamically record?

Can I use uiRecordApi getRecord to get dynamically record? I am developing a custom lightning web component which can be placed on different record pages (Account, Contact, and Custom objects). I am ...
Patlatus's user avatar
  • 15.8k
1 vote
0 answers
146 views

How to properly notify the data service of all modifications when imperative apex method is called from LWC

Per the documentation Refresh the Cache When Calling a Method Imperatively we need to notify the lightning data service that we used an imperative apex method to modify some records in order for it to ...
rStrunk's user avatar
  • 67
0 votes
2 answers
43 views

Capture record update via LEX user interface inside custom Aura Component

I have a custom component used within the Utility Bar reflecting the context record field values (See below): <aura:component description="EC_RelatedTo" implements="force:...
Mateusz's user avatar
1 vote
3 answers
4k views

Refresh specific LDS cache entry in lightning web component?

To demonstrate a specific issue with LDS cache, I have created simple lightning web component that displays list of accounts (filterable by account type) using lightning-combobox and lightning-...
arut's user avatar
  • 5,206
0 votes
0 answers
436 views

Refresh the page from the Lightning component

I am having the Lightning component that uses the Lightning Data Services to update the fields on the Case record, it works fine if the component is updating fields like status or origin like that. ...
user81642's user avatar
  • 669
0 votes
1 answer
11k views

Retrieve the field values of record in Lightning Component

I am using the Lightning Data service in my Lightning Component to update a case record, before I do update the record I need to check on the field value and update accordingly. Below is my component &...
user81642's user avatar
  • 669
0 votes
0 answers
117 views

Replace the Lightning Components which uses Apex to Lightning Data Service

I currently have the lightning component which updates some of the fields on the Case record and also inserts the Case Comment and associates to the case where the fields are updated through the Apex ...
user81642's user avatar
  • 669
-1 votes
1 answer
104 views

List Order by number value [closed]

i convert json to list: [ { name: "file.png", time: 1600813341124345 }, { name: "file2.png", time: ...
pedroooo's user avatar
  • 125
0 votes
2 answers
2k views

Handle error in Lightning Component using Lightning Data Service

I am having a lightning component that uses the Lightning Data services. The component is like below which has a button which when clicking on it changes the case status to Closed. <aura:component ...
user81642's user avatar
  • 669
0 votes
1 answer
2k views

Handling the errors on the lightning aura component

I currently have the aura component makes a call to the server (apex class) and updates the record, I post a toast on the page if any error that happens while updating the record like below var ...
user81642's user avatar
  • 669
0 votes
0 answers
147 views

Lightning component is not updating the field

I am trying to make use of LDS in the lightning component to change the status of the case like below <aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" ...
user81642's user avatar
  • 669
1 vote
1 answer
250 views

Replace Apex Class with the LDS in lightning component

We have a lightning component in the Case Record Page layout which changes the case record status to closed on click of it.The lightning components makes a call to the Apex Class and updates the ...
user81642's user avatar
  • 669
0 votes
1 answer
849 views

lightning:recordEditForm creating two records

I have a custom lightning component, in which using lightning:recordEditForm I'm creating a case record, This component is on EmailMessage object. When I click on save it creates two case records, in ...
salesforce Developer's user avatar
0 votes
1 answer
391 views

Getting error using the lightning Data Services

I am trying to understand how I can leverage Lightning Data Service instead of calling Apex Class to retrieve the record details and updating it. Here I am having a simple button which has to update ...
user81642's user avatar
  • 669
4 votes
0 answers
546 views

Lightning Knowledge component is not refreshed when the case changed programatically

In the detail page below, the standard Knowledge component is properly refreshed when I change the "Verbatim (English Language)" field through the UI. However, if I change the value of "Verbatim (...
Saulo's user avatar
  • 957
0 votes
1 answer
128 views

LDS: targetFields in force:recordData not re-evaluating

So I have a very simple component that has force:recordData. Since it is not a synchronous operation, initially simpleRecord attribute shows null in init handler. In updateRec method, I can see the ...
lambad's user avatar
  • 375
0 votes
1 answer
843 views

LWC Account form update on Contact Record Page [closed]

I want to display a form (LWC) in a Contact record Page to quickly update some fields. There is a way to achieve this whithout using apex, only Lightning Data Service?
Vinicius Regis's user avatar
0 votes
1 answer
139 views

LWC: Delete all dates if first date deleted

Method 'delete all dates of previous date deleted' is not working. When i refresh page all dates on the same place except first date - it's deleted. IF YOU DON'T WANT TO ANSWER, PLEASE SEND REASON ...
Ivan S.'s user avatar
  • 329
0 votes
0 answers
1k views

LWC: How create/edit record with fields displayed depending on the values ​of these fields

How create/edit record with fields displayed (hide/show) depending on the values ​​of adjacent fields? What are the best practice for that case? Thank you! For example: HTML <template if:true={...
Ivan S.'s user avatar
  • 329
0 votes
0 answers
311 views

Unable to read SObject in LWC

I have a problem which I think could be an LWC bug. I need to pass an object, in this case a contract, which I get from @wire getRecord: have seen that there is a similar thread, which reports ...
Diego Lucas Romero's user avatar
0 votes
1 answer
946 views

Loading/ View records of Account using Lightning data service (force:recordData component)? [closed]

I have been practicing the examples given in Lightning developes Guide and the topic is Display Record Data in a Custom User Interface Using force:recordData I copied and pasted the below code ...
MAYANK SINGH's user avatar
1 vote
1 answer
844 views

Multiple Dependent Wire getRecords

I'm fetching two custom objects in a LWC. Object A__c is the record page's object and is fetched by its $recordId. It has a lookup field which points to object B__c's Id. @track bId; @wire(getRecord,...
d2013's user avatar
  • 91
0 votes
1 answer
1k views

Prevent Lightning Data Service Caching - <lightning-record-edit-form>

Context I have a custom Lightning Web Component that allows modification of multiple records inside of modal. Once a record is updated, I reload that same record-id, but the old data shows up ...
Mr. B's user avatar
  • 425
1 vote
1 answer
2k views

Is it possible to use Lightning Data Service to retrieve all records of a giving SObject and avoid writing a custom AuraEnabled method?

I'd like my LWC component to retrieve all records of an SObject type without having to create a custom AuraEnabled method using Lightning Data Services. Is this possible?
Saulo's user avatar
  • 957
0 votes
1 answer
245 views

Populate Lightning-DataTable With Case Data

I am trying to populate a Lightning Web Component that I put together with particular Case fields. No matter what I try, I can't get any data into my Lightning-DataTable. Does anyone know how to do ...
Mr. B's user avatar
  • 425
1 vote
3 answers
416 views

Is Lightning Data Service dependent on a field being part of a Layout?

I have a component that drops into a record page sidebar (Lead or Contact). It uses LDS to pull data for the record, including the MobilePhone field. I'm noticing that if the MobilePhone field is ...
PatMcClellan__c's user avatar
14 votes
2 answers
4k views

Retrieving Geolocation fields from a Lightning web component using getRecord()

I am attempting to retrieve the value of a Geolocation field in a Lightning web component by using wire service with the uiRecordApi's getRecord() method. I can import the compound field or its ...
Joe Flowers's user avatar
1 vote
1 answer
2k views

force:recordData not loading any data

I'm trying to load data using Lightning Data Service with force:recordData, but i'm not seeing any data is being displayed. Below is the code for the same. Can you someone help me where I'm doing the ...
Krishna N's user avatar
11 votes
4 answers
5k 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 ...
Robert Sösemann's user avatar
1 vote
3 answers
2k views

lighting data service layout styling

I'm creating a set of components to override the standard view and edit actions on an object. I've explored using <lighting-record-form> and <lightning-record-view-form>/<lightning-...
TemporaryFix's user avatar
  • 2,867
3 votes
1 answer
5k views

LWC: Get UserInfo using Lightning Data Service

I am playing around with Lightning Web Components and I was wondering if there is a way to pull the UserInfo.getTimeZone() using Lightning Data Service? I was thinking along the lines of: import ...
Arthlete's user avatar
  • 4,773
0 votes
1 answer
698 views

On page load of the Aura Component i'm not able to get logged-in/current User ProfileID using force:recordData

On page load of the Aura Component i'm not able to get logged-in/current user Profile ID or Profile Name using the LDS force:recordData Here is the code from the component and JavaScript controller ...
Maverick's user avatar