Stack Exchange Network

Stack Exchange network consists of 174 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.

0
votes
1answer
38 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
35 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
48 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
38 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
0answers
25 views

Lightning Data Service - Creating Record Error after Validation hits

I'm having an issue with saving a created record on a custom object. What is weird is that it works with another custom object I created. Basically what is happening is that it throws a validation ...
0
votes
1answer
49 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
35 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
21 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
47 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
29 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
51 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
54 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
121 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
59 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
45 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
33 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
307 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
106 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
63 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
55 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 ...
2
votes
2answers
1k 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

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
90 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
189 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
61 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
513 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
533 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
652 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 ...
2
votes
1answer
307 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 ...
0
votes
1answer
52 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
58 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 ...
0
votes
0answers
54 views

Lightning Component in Quick Action can not process delete or update records action on Salesforce1

The issue is that calling a Lightning Component (Parent Component and some child components) from Quick Action on SF1. I can create a new record by Lightning Data Service, but can not delete or update ...
1
vote
1answer
910 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
305 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
291 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 ...
2
votes
0answers
361 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
60 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....
0
votes
0answers
153 views

Error while using force:recordData 2 times in Component

I am using 2 times force:recordData. one is to get case record details and another is to create record on work order object. Component Code: <aura:component implements="flexipage:...
1
vote
1answer
250 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
649 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
297 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
529 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 ...
2
votes
3answers
1k views

confused on force:recordData!

while I'm going through the tutorial on Lightning Data Service, I can see that they use force:record data to perform all the CRUD operation and eliminate the need to write apex controller. but I did ...
12
votes
1answer
2k 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 ...
5
votes
1answer
528 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
2answers
957 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 ...
0
votes
1answer
1k views

getNewRecord to create an empty record - Lightning Data Service

I am trying to creating a new record using LDS for that I have first create a template record which can be used to create a record. I followed the example present in - https://developer.salesforce.com/...
1
vote
1answer
4k views

$A.getCallback() [Cannot read property of null- Simple form

I keep getting $A.getCallback() [Cannot read property of null when I start typing in the text fields of a form. Before adding the default I have the component as below: <aura:component ...
0
votes
1answer
589 views

Lightning Data Service, insert new record then clear and insert another

I am trying to use Lightning Data Service, force:recordData, with a component to insert new records. It successfully inserts one but then I want to clear the text and be able to insert another. Is LDS ...