Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [lightning-data-service]

The tag has no usage guidance.

1
vote
0answers
33 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
39 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
78 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
85 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
44 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
320 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 ...
1
vote
1answer
330 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
76 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
165 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
92 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
99 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
39 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
617 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
100 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'...
0
votes
1answer
202 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
184 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
29 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 ...
0
votes
2answers
1k 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
40 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
133 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
277 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
312 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
116 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
97 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
56 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 ...
1
vote
1answer
422 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
195 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
98 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 ...
0
votes
0answers
90 views

Redirect a user from a record page back to a specific opened page

I am not sure that the problem is appropriate for a single question, but in order to avoid x-y problem I will fully explain it and at the end formulate a concrete question. So, I have a page: A user ...
3
votes
2answers
4k 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
63 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
141 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
300 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
102 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
922 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 ...
7
votes
1answer
778 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
1k 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 ...
4
votes
2answers
676 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
1answer
85 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"...
0
votes
1answer
98 views

Retrieve Community Contact fields in force:recordData

Is there a way to retrieve Community user's contact fields in force:recordData? This is my first lightning coming, and I'm not finding proper information on this. I'm trying to display the logged in ...
1
vote
1answer
2k views

Lightning Data Service display related records

I am trying to display Contact details on a Lightning Data Service component on the Case Level. An example SOQL query that is working is Select ContactId, Contact.FirstName, Contact.LastName from ...
1
vote
1answer
467 views

Lightning Data Service TargetRecord on PageLoad

I'm trying to use Lightning Data Service to retrieve fields without Apex/SOQL but I'm receiving errors due to my targetRecord being null on a page load. I have a function in my JS controller which I'...
1
vote
2answers
397 views

Calling a lightning form/modal that is its own component

I'm building a lightning page using several lightning components and using lightning data service. I would like to keep components as reusable as possible. What I am trying to accomplish is when ...
3
votes
0answers
442 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 ...
5
votes
0answers
87 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....
1
vote
1answer
350 views

force:recordData - LDS

I am comng across an error that I am unsure how to solve. I am using force:recordData to update a field. Component <aura:attribute name="record" type="Object" /> <aura:attribute name="...
7
votes
2answers
1k views

Practical Use of Lightning Data Service

From the trailhead/docs I understand LDS is similar to Standard Controllers. I followed this example given in the docs to understand more about it. https://developer.salesforce.com/docs/atlas.en-us....
2
votes
2answers
592 views

Must Lightning Data Service always respect running user's object/field access?

For simple component work, I prefer to use Lightning Data Service as opposed to @AuraEnabled Apex. And while I have not seen this documented, it appears that the Lightning Data Service always ...
0
votes
1answer
1k views

lightning:recordViewForm delay loading data

Is this common that field data loading in lightning:recordViewForm is having bit delay? Is there a way we can avoid this delay? <force:recordData recordId="{!v.recordId}" ...
2
votes
3answers
609 views

Lightning data service - Edit mode & Spring'18 “new feature”

I have components written during Winter'18. After the rollout of Spring'18 preview they stopped working. The components fetch fields (either via layoutType=FULL or mentioned by name) that happen to be ...