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.

25 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7
votes
1answer
2k 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'...
5
votes
0answers
98 views

Stub Lightning Data Service response in Lightning Test Service (Jasmine)

Using Jasmine I can simply stub response as this before $T.createComponent: $A.enqueueAction = jasmine.createSpy().and.callFake((action) => { var cb = action.getCallback("SUCCESS") cb.fn....
3
votes
0answers
45 views

Why does Lightning Data Service fails quietly when trying to load converted lead?

I was hoping to make subsequent request by picking up ConvertedAccountId, ConvertedOpportunityId, etc, but seems that is not possible - will I have to fallback to Apex? Is that expected behaviour? ...
3
votes
1answer
325 views

lightning:recordEditForm Account Name binding issue in salesforce person account orgs

I run into a issue when using lightning:recordEditForm to together Account Name info in an org where Salesforce Person Account is turned on. I was trying to bind to a business account and edit the ...
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 ...
3
votes
0answers
595 views

Lightning Data Service not updating field

I am having 2 issues. One is, when I am updating a field, there are some field validations that are not getting flagged in my code. The second is when I have met the criteria, the field does not ...
2
votes
0answers
134 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 (...
1
vote
1answer
203 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,...
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 ...
1
vote
0answers
303 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 ...
1
vote
1answer
282 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 ...
1
vote
0answers
38 views

Lightning Data Service Interaction with Page Edit giving error

I have created a Lightning component to display nearBy accounts using Geolocation for a given Account. I am able to display a list of locations passing BillingLatitide and BillingLongitude from the ...
1
vote
0answers
551 views

Lightning Data Service not showing Validation Rule Errors

As part of Salesforce's low code policy, I have been tasked to remove some apex code which simply updates a field within a try catch. If a validation rule occurs, it is caught and I process the result ...
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 ...
1
vote
0answers
109 views

Lightning Data Service support in Lightning Out

I am currently working on developing a new Lightning application and wanted to use Lightning Data Service. However I see from the Dev Guide (https://developer.salesforce.com/docs/atlas.en-us.210.0....
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 ...
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
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
0answers
225 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 ...
0
votes
1answer
656 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="{!...
0
votes
1answer
255 views

Are Address fields are restricted to save in LDS?

Am writing lightning component on quote object for Billing Address using LDS. API Name(standard field) - BillingAddress I have an ui:inputSelect for BillingCountry and trying to save like below, ...
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 ...
0
votes
1answer
957 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
0answers
439 views

Unable to fire custom event in Lightning Data Service saveRecord callback function

I'm trying to fire a custom event in a child component to notify the parent that a case record has been saved and that it should perform an appropriate action. I'm finding that inside the saveRecord ...