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
0answers
11 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
29 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
31 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
33 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 ...
1
vote
1answer
46 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
1answer
27 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 ...
7
votes
2answers
242 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 ...
1
vote
3answers
51 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-...
1
vote
1answer
40 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
0answers
27 views

Lightning Data Service saveRecord NOT_FOUND error

A little description of my issue and our org: We have 2 types of customers. One of those types are Contacts in our org, and the other type is Person Accounts. Note: some of our customers can have ...
0
votes
1answer
28 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 ...
0
votes
1answer
36 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 ...
5
votes
1answer
229 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
47 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 ...
1
vote
0answers
63 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
86 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
272 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
138 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
84 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
2answers
781 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 ...
2
votes
1answer
667 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
1answer
158 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 ...
1
vote
2answers
274 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 ...
1
vote
1answer
165 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
206 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="...
3
votes
0answers
40 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? ...
1
vote
1answer
1k views

Lightning Data Service - Update Field on Button Click

I am new to lightning components and am trying to get a button in lightning to update a checkbox on a contact record(Send_to_IFS__c) when the button is clicked. Below is what i have but it is not ...
-1
votes
2answers
123 views

Change Button label in $A.get(“event.force:createRecord”) modal popup

I've got a requirement to change label of Save buttons shown in New Record Modal which pops up when event.force:createRecord is fired. Just wondering, if this is possible through some event param or I'...
1
vote
1answer
310 views

Is it possible to use Lightning Data Services \ <force:recordData without sharing rules \ field level security?

It is possible to declare a Apex controller class as public without sharing class noSharing { } Is it possible to use Lightning Data Services <force:recordData Without sharing \ field level ...
0
votes
1answer
280 views

How to load Lead.Address fields using Lightning Data Service

Got pretty basic task of loading Lead info via LDS. Whenever this page loads, LDS doesn't do anything - no error, no warning. <aura:component implements="lightning:isUrlAddressable"> <...
1
vote
0answers
34 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 ...
2
votes
2answers
3k views

Lightning Data Service: aura:if NOT condition

I am writing a new Lightning Component to conditionally render a message based on a few field values. I am close to having the conditions render like I want, but I can't figure out how to write in a ...
0
votes
1answer
42 views

Connecting Lightning Data Service to apex controler

I'm having trouble implementing a solution when using an action in the account context, calling a component that passes certain fields to an apex controller. The idea is to use Lightning data service. ...
0
votes
2answers
172 views

Cannot read property 'WhoId' of null when using lightning data service with task

I am actually using force:recordData to get info from a task and then I want to create an event from it. So I created a lightning component to be used in a lightning action. The component code is as ...
1
vote
1answer
448 views

How to add pick-list field while using LDS

I am not able to display the salutation pick-list field on the lightning component, I have tried lightning:recordEditForm and force:recordData Can someone please suggest the right path to show the ...
0
votes
1answer
424 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
159 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, ...
1
vote
1answer
132 views

Add picklist to community based form using lightning data service

I've got two fields on a Contact that I want to ask on a separate page with some verbiage on it and for some reason, I cannot get any of the LDS record handlers to work properly. I thought I would be ...
2
votes
1answer
74 views

How to deal with users without permission while using Lightning Data Services?

To be more specific, I have the following scenario that just happened: I developed a component on a sandbox (development environment). This component uses force:recordData to retrieve some field data ...
2
votes
1answer
489 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. ...
3
votes
2answers
270 views

How to use v.sObjectName to define fields in Lightning Data Service

To use my Lightning component for record pages of multiple types I need to load the record in a generic fashion. <aura:component controller="MyCtrl" implements="force:hasRecordId,force:...
4
votes
1answer
118 views

Is it prudent to use force:recordData (and similar) within aura:iteration?

The aura framework and lightning:recordData currently (Summer 18) support only single object retrieval. Let's assume I got a listItem.cmp into which I wired force:recordData in VIEW mode or a ...
3
votes
2answers
5k 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
68 views

What are the similarities/differences between force:recordData attributes

I've just completed a few Lightning Component Trailhead modules and the last one discussed the Lightning Data Service which introduces <force:recordData ... />. For some examples, they use ...
3
votes
1answer
205 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 ...
1
vote
0answers
359 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
1answer
116 views

Do you have to use the value returned from force:hasRecordId to use Lightning Data Service?

I've tried using the Id from a lookup field involving the record being view in my lightning component. I query this data in init, then set the returned value to theCase. <aura:component ...
0
votes
1answer
1k 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 ...
8
votes
1answer
1k views

Show form with page layouts && intercept save … Lightning:recordForm / force:recordData

Somewhat flummoxed with this lightning component. The use case is simple: Intercept the save event on a record edit, grab the new field values and do 'stuff' before saving the record. Example User ...
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 ...