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
1answer
21 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 ...
2
votes
2answers
579 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 ...
0
votes
0answers
24 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" ...
0
votes
1answer
658 views

Using Lightning Data Service not able to save custom lookup field on record creation

Below is Lighting Component <force:recordData aura:id="RecordCreator" recordId="{!v.recordId}" layoutType="FULL" targetRecord="{!...
1
vote
1answer
48 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 ...
0
votes
0answers
21 views

Get fields from Lookup object using LDS (Lightning Data Service)

Suppose I have two custom objects: Property and Broker. Property has a lookup field to Broker. Suppose now I need to create a custom aura component inside a property record page that shows only the ...
0
votes
1answer
966 views

Trailhead “Build a Lightning Component to Override a Standard Action” - “Use Lightning Data Service”

I am stuck at the Trailhead: "Build a Lightning Component to Override a Standard Action" - "Use Lightning Data Service" with the error: "Challenge Not yet complete... here's what's wrong: The ...
0
votes
1answer
2k views

How to use standard layout with force:recordData?

I'm trying to use the force:recordData to clone a record with some fields changed in the backend. I am able to retrieve it to the front-end. But unfortunately it seems force:recordData doesn't refresh ...
3
votes
2answers
2k views

How to use force:recordData to clone a record?

I'm trying to clone an Opportunity record with certain values changed. Below is my code (component will be launched from Lightning component action). My Component Markup <aura:component ...
0
votes
1answer
34 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 ...
2
votes
0answers
136 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 (...
0
votes
1answer
36 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 ...
1
vote
2answers
2k views

Save Error - Undefined - Lightning data service

I am trying to save a record that a user creates using a form. I get a strange error description as "Undefined" which I do not understand. Below is my component, controller and helper class. The save ...
7
votes
1answer
3k views

Get records in Lightning web components without APEX

import { LightningElement, track, api, wire } from 'lwc'; import { getRecord } from 'lightning/uiRecordApi'; const FIELDS_SOLICITUD = [ 'DCABM_obj_solicitudABM__c.DCABM_fld_aplicacionSolicitud__c'...
0
votes
1answer
24 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 ...
1
vote
2answers
2k views

Reload Lightning Data Service after updating the record on the server

I have a parent component that uses lightning data service (lds) to get the record. This record is then shared to all of it's children as needed using data binding. I need to update the record using ...
0
votes
1answer
100 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?
8
votes
4answers
1k 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 ...
4
votes
2answers
8k views

Lightning Data Service - Get record value during Component Initialization in Controller

I have a quick action in Account object which loads a Lightning Component. I need to get the record values during initialization (in the doInit function) in the JS Controller without using Apex. I ...
0
votes
1answer
50 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 ...
0
votes
0answers
233 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={...
0
votes
0answers
32 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 ...
1
vote
1answer
204 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,...
0
votes
1answer
185 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 ...
0
votes
1answer
514 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 ...
1
vote
1answer
231 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?
0
votes
1answer
98 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 ...
1
vote
3answers
120 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 ...
0
votes
1answer
405 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 ...
1
vote
3answers
469 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-...
2
votes
1answer
558 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 ...
0
votes
1answer
65 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 ...
2
votes
1answer
570 views

Editable lightning:datatable with Lightning Data Service?

Its it possible to rig up editable lightning:datatable to do saves via lightning data service? In the few samples (very few) saves requests are sent to an APEX controller that you need to write. ...
0
votes
1answer
109 views

lightning data service : picklist field not showing

Is picklist not supported in lightning data service when using with lightning:input <lightning:input type="text" label="Description" value="{!v.simpleRecord.Description__c}" /> I need to use ...
0
votes
1answer
154 views

How force:recordData identifies the sObject type?

In lightning:recordForm we give objectAPIName but in force:recordForm we do not specify any such attribute So, How does force:recordData identify the sObjectType? Assuming there is no value for ...
4
votes
1answer
1k views

Unable to save a record using LDS

I use lightning data service method SaveRecord to create a record of type BoatReview__c. The boatReview__c object has following fields: I only populate Name and comment__C field using a form on my ...
1
vote
0answers
133 views

Handling Success Save Event for LDS new record

I am trying to handle the success save event of LDS saveRecord method. I need only proper Id from the new record response. In DESKTOP it's working fine whereas in Mobile/Tablet i am getting improper ...
16
votes
1answer
4k views

How efficient is Lightning Data Service when working with multiple records?

I've seen quite a few Lightning Data Services posts pop up recently. This question used it to work on a set of records as opposed to a single record. The way it was coded had me worried thinking that ...
1
vote
1answer
288 views

I'm unable to get private attribute from a component to use in force:recordData

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,force:hasRecordId" access="global" >     <aura:attribute name="boatReview" type="BoatReview__c" access="global"...
4
votes
2answers
2k views

force:recordData “recordUpdated”: Detect Trigger/Workflow Changes

I'm using Lightning Data Service in a component. It all works well. One item I've noted is that it does not seem to detect changes to fields which may have occurred via a trigger or workflow after a ...
1
vote
0answers
305 views

Rollup Summary fields are not updated

We have built a custom lightning page showing account summary in the top and users can create income and expense (custom object) as child records to account. We have rollup summary fields on account ...
4
votes
1answer
629 views

Lightning Data Service - Dynamic Fields

I am creating a dynamic navigation (button) component to be used throughout the org. I am trying to provide system admins the ability to specify the data (field/fields) to be retrieved by the force:...
-2
votes
1answer
185 views

Lightning Web Component [duplicate]

Is this the right time to start switching to Salesforce's new Lightning Web Component model (Is this perfectly compatible with Lightning Aura model, Lightning Data Service, Lightning Design System ...
0
votes
2answers
150 views

Using LDS without force:hasRecordId

I've seen sfdcfox's answer to a similar question, yet am unable to replicate the result in my own component. I'd like to load a User's custom field via LDS with a User Id provided by my client ...
1
vote
1answer
267 views

Lightning Data Service will not load record

I just refreshed my dev sandbox and my staging sandbox. In my dev, lightning data service is able to load the record. When I go into my staging environment, which is a partial copy sandbox, no record ...
2
votes
1answer
1k views

lightning:recordEditForm not working without force:recordData

The recordEditForm is not supposed to need the Lightning data service provided by recordData however in the below example the only time fields beyond the first one show up are if I also include the ...
1
vote
2answers
588 views

When do you need to manually reload a lightning data service record?

I use lightning data service (lds) multiple times in different parts of my app. Each use of lds involves the same record. Do I need to manually reload it each time a change event is detected? So say ...
0
votes
3answers
646 views

navigateTo : New record

I have replaced the standard "New" functionality on a custom object, and I want to navigate to the newly created record after save. I have looked at the developer documentation, and I get that I need ...
1
vote
1answer
285 views

__pc field is not showing force:recordData lightning data service

We have person account enabled org we are unable to get some formula fields and __pc fields through lightning data service we chaecked FLS and everything look correct other fields are coming but ...
0
votes
1answer
353 views

Can I use single `force:recordData` for both Add & Update record?

I have a requirement where I need to insert and update a contact. Now, I am using force:recordData. <force:recordData aura:id="ldsContact" recordId="{!v.selectedUserId}" layoutType="...