Questions tagged [lightning-inputfield]

A lightning:input component creates an HTML input element. This component supports HTML5 input types, including checkbox, date and datetime-local, email, file, password, search, tel, url, number, radio, toggle. The default is text.

Filter by
Sorted by
Tagged with
17
votes
2answers
14k views

How to submit a lightning:recordEditForm from a button that isn't nested?

The lightning:recordEditForm documentation provides this example: <aura:component> <lightning:recordEditForm recordId="003XXXXXXXXXXXXXXX" objectApiName="Contact"> <...
15
votes
2answers
4k views

Anyone got a lightning:inputField working for a lookup?

I have a lightning:recordEditForm containing lightning:inputFields that I want to use to create a simple custom object. The 3 fields are: A picklist A lookup to Contact A lookup to Account presented ...
12
votes
5answers
7k views

Pre-populate field values in lightning:recordForm onload

I'm using lightning:recordForm to display create view for a custom sObject. It works as expected, but I cannot find a way to pre-populate some of the fields for create view, e.g. lookups. ...
12
votes
2answers
934 views

Is it possible to use the new v41.0 lightning:outputField in huge numbers inside tables? Is it possible to extend it?

Today I'm giving the new v41.0 <lightning:outputField> a try. I want to use it massively inside an <aura:iteration> to build a data-table and want to accomplish the following: ...
9
votes
1answer
9k views

Setting attribute required to lightning:inputField

in Salesforce classic I created an object ,Equipment__c' and the field ,License plate' amongst others. We are using the object ,Equipment__c' for different types of equipment. For trucks the field ,...
8
votes
1answer
3k views

Is it possible to use lightning:recordEditForm dynamically on different object types with variable objectApiName?

I need to create an edit component for an SObject from which I do not know the objectApiName at design time. I only know the Id of the SObject. objectApiName could be any valid SObject-name. Now I ...
7
votes
1answer
493 views

Is it possible to mass-save many lightning:recordEditForms with only ONE button?

Im implementing an line item editor for the "Order" SObject and want give lightning:recordEditForm with lightning:inputField a try for this. What I have so far is an edit for the order combined with ...
7
votes
2answers
277 views

accessing a lighning inputField lookup name client side

I am easily able to fetch a lookup ID from a inputField <lightning:recordEditForm objectApiName="Case"> <!-- the messages component is for error messages --> <...
6
votes
2answers
5k views

I'm unable to enter values in my lightning input

Hi I'm totally new to lightning. I'm trying to create a form with input fields. But I'm unable to enter any values or set date or toggle the checkbox. Here is the lightning component. I have added ...
6
votes
3answers
7k views

Make field required with lightning:inputField and lightning:recordEditForm

There is no setting for the lightning:inputField to make it required. idea: https://success.salesforce.com/ideaView?id=0873A000000lKNbQAM docs: https://developer.salesforce.com/docs/component-...
6
votes
3answers
3k views

How to use $A.createComponents() on lightning:recordEditForm with nested lightning:inputField?

I've asked this question to change the objectApiName attribute of lightning:recordEditForm. Thanks to the great answer of @PranayJaiswal I found a workaround. Now I soon will face the need of having ...
6
votes
1answer
2k views

How to validate the values before saving a record through lightning:recordEditForm and lightning:inputField?

I'm using lightning:recordEditForm and lightning:inputField to update a record. I need to validate the values before updation and I couldn't find any ways to get the values from lightning:...
6
votes
2answers
884 views

Did they break lightning:input with Summer'18?

I'm aware that it's still beta, but I didn't expect them to break it for older api versions :/ <aura:application extends="force:slds"> <aura:attribute name="myNumber" type="Decimal" ...
6
votes
1answer
3k views

Add onchange event for lightning:inputField in $A.createComponents

I am trying to create a lightning:inputField using $A.createComponents. The issue I have is that I am not able to add an onchange event. The field Level__c is a picklist field. When I use the ...
5
votes
2answers
1k views

Lightning InputField component with Salutation field

I'm using the lightning:recordEditForm with lightning:inputField and it's going quite successfully. However, I've run into an issue with the Contact.Salutation field. It works when it's a part of the ...
5
votes
1answer
447 views

variant='label-hidden' Not Working for lightning-input-field When field is a Lookup

I have a Lightning Web Component and in that I'm using a lighting-record-edit-form. I'm trying to use a custom label for an input by hiding the default one for the lightning-input-field and adding my ...
4
votes
2answers
7k views

How to do field validation on lightning:recordEditForm with lightning:inputField

Background I have a lightning component with a lightning:recordEditForm for creating new Opportunity records. The lightning:recordEditForm contains many lightning:inputField 's I would like to ...
4
votes
1answer
938 views

Are Lookup Filters supported in Custom Lightning Components?

So, there are two ways to get Salesorce Standard Lookup filed in Lightning components: force:inputField and lightning:inputField. However, no matter what I do, I can not get lookup filters to work. ...
4
votes
1answer
627 views

recordEditForm with inputField on lookup does not work properly when searching or creating a record

Is it just me or is this an error in the salesforce standard lightning components? Here is what happened up until now: I want to create a new record with lightning:recordEditForm. This record has a ...
3
votes
1answer
4k views

lightning:input (text) - is it possible to have multiple patterns

I have a field that checks for 2 patterns. What I currently have is, in the text field's onchange handler, i check if the inputted string matches a certain pattern. However, I want to use lightning's ...
3
votes
1answer
5k views

Lightning:inputField not allowing decimal numbers to be inserted

I am using <lightning:recordEditForm> and <lightning:inputField fieldName="customField"/> to create a form. My custom field is Number field with setup number(16,2) - length 16, decimal ...
3
votes
2answers
9k views

Set field values on lightning:recordEditForm (record create mode)

I am using lightning:recordEditForm to display records that may be new or existing. This is working nicely, however I now want to preset one of the fields. The fields are displayed using lightning:...
3
votes
2answers
2k views

Binding lightning:inputField to a client-side SObject instance not an SObject Id?

My reading of the lightning:inputField and related lightning:recordEditForm docs is that the record is read and written based on the Id supplied via the recordId attribute. There is no option to bind ...
3
votes
1answer
60 views

How to programmatically submit a lightning-record-edit-form?

The lightning-record-edit-form has a documented submit method that I assume can produce similar behavior to a click on a nested submit button. But I can't find any examples of this. The documentation ...
3
votes
0answers
402 views

Are lightning:recordEditForm and lightning:inputField a bit buggy in Spring'18?

I'm trying to get my hands on lightning:recordEditForm and lightning:inputField Im using it on Order Line Item like this <lightning:recordEditForm recordId="{!item.Id}" objectApiName="OrderItem" &...
3
votes
0answers
995 views

lightning:inputField as lookup missing “New Record” option

Is it just me or is the lightning:inputField component missing the "New Record" option when it's rendered as a lookup? Right now I have to type a value in the lookup field, hit enter, and wait for ...
2
votes
1answer
861 views

lightning:inputField Lookup mobile

So I know that on mobile <lightning:inputField> for lookup fields doesn't work. It's right there in the documentation (not clearly, but it's there if you know what to look for). But if you check,...
2
votes
1answer
80 views

Displying Salutation field using lightning:recordEditForm on Person Account

There is a known uncommon behavior with Salutation field on Contact object while displaying it using lightning:recordEditForm. Since it is a part of the compound Name field on Contact. The workaround ...
2
votes
1answer
110 views

lightning:input methods - which are available? [closed]

Mistake in Lightning Component docs or my misunderstanding? From the Lightning Component Reference at the very bottom of the "Documentation" tab it reads, This component supports the following ...
2
votes
1answer
2k views

Component set() does not work on lightning:inputField if user changes the field value

I'm finding the component.set method only works on lightning:inputField components when the user has not changed the value in that field. See code example below. Component: <lightning:...
2
votes
1answer
2k views

lightning:inputfield - lookup fields in Lightning Experience, Salesforce Mobile App and Lightning Out

I’ve been experimenting with the new lightning:inputfield and it seems that the lookup fields don’t work in the mobile app or in Lightning Components which have been embedded in VF pages. Can people ...
2
votes
1answer
2k views

Spring 18 : Value Attribute in lightning:inputField

i am trying to set value to the lightning:inputField using the value attribute. The value attribute seems to work during the init handler event of the component. however i have a onchange for ...
2
votes
1answer
549 views

How to prepopulate Address field in lightning:inputField

I need to prepopulate fields in lightning:recordEditForm and then get their values to save using Apex (without submitting form itself). What I've already tried: ...
2
votes
2answers
279 views

Summer 19 breaks undocumented lightning:inputField feature - variant=“label-hidden”, what are alternatives?

Seems like attribute doesn't work anymore. I know before label-hidden variant, I used to be able to hide labels using some CSS. Unsure what it was anymore.
2
votes
2answers
474 views

Error on double click on lightning:inputField lookup field

I created a lightning:inputField which supposed to show the lookup field for customer. However, when I double click on the field or when I try to select the current entry I get an error message. <...
2
votes
1answer
60 views

Does lightning-input-field automatically respect field level security (FLS) from profile/permission sets?

A strength of Visualforce's apex:inputField is that it automatically respects the view/edit permissions that come from the profile/permission sets for both the object and the fields. I'm assuming ...
2
votes
0answers
1k views

Lightning:input[type=number] value attribute is string instead of number

I encountered a fascinating bug (or feature) in the lightning:input[type=number] component and I was wondering if any of you have had this problem before? I'll describe what happens: My lightning ...
2
votes
1answer
161 views

Access Text Value lightning:inputField lookup

Is there a way to access the text value of a lightning:inputField of lookup type? .get('v.value') returns the ID but I also want to retrieve the text value displayed within the lookup as well.
1
vote
3answers
2k views

For what reason there are force:inputField and lightning:inputField if both of them correspond to Lightning Components?

In a Lightning Components Developer Guide there are two inputFields - [one] in a force namespace and a [second] in a lightning namespace. Looks like both of them serve the same purpose (being an input ...
1
vote
2answers
4k views

Conditional Rendering in Lightning Component with more than Aura:If(True, ELSE)

I have a lightning:select picklist on a Lightning component called "Best Method of Contact" which is a required picklist, but the required picklist defaults to a blank 'placeholder' value that the ...
1
vote
1answer
214 views

Lightning Input on wrapper class not passing back the value

I am using a wrapper class so as not to have a glut of aura:attributes (this may be the problem in and of itself). I have a previous lightning component that has about 16 attributes and passing them ...
1
vote
2answers
1k views

Lightning component focus on lightning:inputField

I have a <lightning:inputField aura:id="inputField1"> in a modal window, and I want to focus on this field when the modal opens, so that the user doesn't have to use their mouse or tab to set ...
1
vote
2answers
1k views

lightning:recordEditForm | Some input fields not being displayed

I'm trying to create a new form for a custom Object in salesforce. This is my form Code: <lightning:recordEditForm aura:id="MyFormId" objectApiName="...
1
vote
1answer
1k views

Set custom placeholder in lightning:recordEditForm

I have a form in Lightning Components written using lightning:recordEditForm. Inside that form I have lightning:inputField which is a lookup. Is it possible to set a custom placeholder in this input? ...
1
vote
1answer
9k views

How to use lightning:outputField and lightning:inputField inside an aura:iteration

How can I use the new v41.0 <lightning:outputField> inside an <aura:iteration>? I have tried this <aura:attribute name="Opportunities" type="Object" default="{}" /> <aura:...
1
vote
1answer
36 views

lightning-input: what is the purpose of message-when-too-long?

The lightning-input component has a documented property, message-when-too-long, which is described as: "Error message to be displayed when the value is too long." in the documentation. Presumably, ...
1
vote
0answers
99 views

Salesforce mobile scrolling issues with input fields

I've been trying to adjust a record form to mobile version of salesforce. However, I'm having issues with scrolling. When I try to scroll down for the first time after page refresh, the screen stops ...
1
vote
1answer
228 views

Can't save Salutation Field when using a Lightning Input Field

I'm making a lightning component with a lightning:recordEditForm and lightning:inputField to edit Contact records. <aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,...
1
vote
1answer
420 views

Lightning:inputField lookup icon missing

I am using the Lightning:inputField to render a lookup (custom object) inside a RecordEditForm. Though the functionality works fine, the object's icon does not render, like it does on a standard edit ...
1
vote
0answers
94 views

How can lightning:inputField support human inputs of “10k” , how to make it support locale and how to make it consistent to other inputs?

I have a the following markup <aura:iteration items="{!v.Items}" var="item"> <lightning:recordEditForm recordId="{!item.Id}" objectApiName="OrderItem"> ...