20

You can manually trigger the submit action of lightning:recordEditForm component without having to use <lightning:button type="button"/> which can be found in the new component documentation UI : https://<myDomain>/componentReference/suite.app Sample code: <lightning:recordEditForm aura:id="editForm" recordId="0032800001DYoc0" objectApiName="...


16

maybe I found a solution to the problem. This is what I have set up: In the object manager do not set the field in question to required. Rather, create a validation rule that checks for blank values. In your component bundle create the following styles. .THIS .customRequired{ font-weight: 400; } .THIS .customRequired:before{ content: "*"; margin: 0 ...


11

Two problems here. Access Variable Name Unlike Visualforce, you're always using an attribute of some sort. Therefore, while you'd say {!Expense__c.Client__c} in Visualforce, in Lightning, you're expected to use your variable: <lightning:input value="{!v.newExpenseObject.Client__c}" ... /> Where v is the global value provider for attributes, ...


9

OOTB, lightning:inputfield handles field validations that are configured through your object's field settings, so that would be the first place you want to check in order to make your fields "required". If for whatever reason, the above is not an option (eventhough it should be), then adding an aura:id that identifies all your lighting:inputfield fields ...


8

You can submit a lightning:recordEditForm programmatically. You can do so by retrieving the component via it's aura:id and calling the submit method. e.g. component.find('editForm').submit() Here are the supporting docs Since you are using the forms in an iteration, you can give them all the same aura:id and your component.find call will return an array ...


8

Use the "OR" operator (|): pattern="(\d{8}|[a-zA-Z0-9]{12}-\d{3})"


8

So I faced a similar issue, I managed to solve it using aura:if aura:if doesnt create the inner components unless the condition is true. You can use it to your advantage. <aura:if isTrue="{!!empty(v.ParentType)}"> <lightning:recordEditForm recordId="{!v.recordId}" objectApiName="{!v.ParentType}"> </aura:if> The inner component and its ...


7

After an extensive discussion with Salesforce support: recordForm may not work with your use case, and the better approach here would be to use recordEditForm. This is only after discussing this with my team in our internal forum. You had a concern that why it doesn't work with recordForm- to which I have mentioned that it will not work with ...


6

I got the same issue while working on recordEditForm. I usd the below hack/workaround to fix it. It worked for me. <lightning:recordEditForm objectApiName="Contact"> <div style="display:none"> <lightning:inputField fieldName="Name"/> </div> <lightning:inputField fieldName="Salutation"/> ...


6

Is it possible at all? No. Are Standard Components extensible at all? No. Even if it would be possible, is extension a good idea? It'd be potentially useful, but we can't. Slow and async rendering You shouldn't be using tables. It's a shame that they actually allow it, because tables are not used anywhere in Lightning at all....


6

You are not able to use validity on lightning:inputField because the attribute is not supported on this component, instead its an attribute for lighting:input. For validating lightning:inputField with lightning:recordEditForm, you can refer to this answer which provides a perspective as how you can validate values entered on the component. For the error ...


5

There is a way to bind the lighthning:inputField value to an Instance of an Object. Here is an Example code, Parent Component: <aura:component > <aura:attribute name="testContact" type="Contact" access="PUBLIC" default="{'sObjectType':'Contact'}"/> <div class="slds-box"> <lightning:recordEditForm aura:id="recordEdit" ...


5

Looks like a syntax error and not referencing attributes properly , try the below <aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,force:lightningQuickAction" access="global" > <aura:attribute name="newExpenseObject" type="Expense__c" default="{ 'sobjectType': 'Expense__c' }"/> <lightning:card> <aura:...


5

I came up with a way to do this; you have to create the children first, and then the parent, similar to how the system would do it in mockup. Here's a demonstration: <aura:application extends="force:slds"> <aura:attribute name="recordEdit" type="Aura.Component[]" /> <aura:handler name="init" value="{!this}" action="{!c.init}" /> ...


4

This is working as designed. onsubmit belongs to the form (or more specifically the button in the form). The assumption is, if you are already outside of the form, i.e. you know that another button/link is going to submit the form, you can just do whatever processing you need before firing the submit method.


4

force:inputfield does not have SLDS baked into it .So there is no out of box styling for the inputfield . Apart from that does not work properly .Specially does not work inside aura:iteration and does not work with lookup fields . lightning:inputField is a revised version and includes SLDS out of box and also is supposed to be better performant .This uses ...


4

The issue seems in the way lightning:inputField has been implemented. Here are some interesting findings around lightning:inputField implementation. And I posted an idea based on this issue on the idea forum for this. Once rendered, lightning:inputField with underlying field as Decimal is rendered as HTML <input type="number" ../>. This HTML tag has ...


4

The attribute is called required, Lightning:input documentation <lightning:input aura:id="field" label="Last name" placeholder="Last name" required="true" /> However, i dont see a lightning:input field in your code, but rather a lightning:Select . (should be the same though) would be good to know if your form is wrapped in a lightning:...


4

I would think the simplest way to achieve is to just write 3 different aura:if blocks. Something as below? <aura:if isTrue="{!v.selectedVal == 'Phone'}"> .. do something .. </aura:if> <aura:if isTrue="{!v.selectedVal == 'Email'}"> .. do something .. </aura:if> <aura:if isTrue="{!v.selectedVal == 'None'}"> .. do ...


4

Winter20 , required attribute available for lightning:inputField from winter 20


4

Well, it looks like it's possible with force:inputField. But that requires a lot more effort on my part, client side and server side. Markup <aura:attribute name="record" type="MyObject__c" default="{'sobjectType': MyObject__c'}"/> <aura:attribute name="myValue" type="string"/> <aura:attribute name="editRecordId" type="string"/> <...


3

For now quick fix is CHECK "Allow reparenting" checkbox for the Master-Detail field on the child object. You will not get error


3

as @Himanshu commented - lightning:input does not support SLDS yet, But ui:inputDate does: <ui:inputDate displayDatePicker="true"/>


3

Not sure if this is the best solution but basically I tried to set the field value after component-init and it worked: doInit : function(component, event, helper) { var fieldValue = component.get('v.fieldValue'); component.find('input_field').set('v.value', fieldValue); } where input_field is the id of the target lightning:inputField component: &...


3

You'll want to read Validating Fields for more information, but generally speaking, you need to check the validity before sending the data off to the server. Nothing in the framework prevents calling the server while in an error status. createRecord: function(component, event, helper) { if(component.find("Type").get("v.value")) { // send to server } ...


3

OwnerId is not supported in lightning:inputField. Refer to the excerpt below from documentation: Lookup: Displays an input field for creating a relationship between two objects, for example, the account associated to a contact record. The lookup type is supported in Lightning Experience only. Mobile lookups are not supported. When used in the mobile app, ...


3

lightning:inputField does not support focus as per their official documentation. src: https://developer.salesforce.com/docs/component-library/bundle/lightning:inputField/specification


3

I'm new to lightning, but two things I see: The type name in your component isn't matching the class name: 'AppWrapper' versus 'CreditAppWrapper' The properties you are exposing aren't primitive types, so yes, they'd need to instantiated.


3

Your default record type id might be business account because of which Salutation will not be rendered. You should give record type id of person account in form to render Salutation. You can get person account record type id using SOQL: SELECT Id, Name, DeveloperName, SobjectType, IsPersonType FROM RecordType WHERE SobjectType='Account' AND IsPersonType=...


2

Edit by Uwe Heim: I made two mistakes: I needed to use "{!item.Id}" instead of "{item.Id}" notice ! I used the wrong attribute type Object but needed to use Opportunity[] Original Answer: If you read debug you will find reason of this issue. [Record ID {item.Id} is not a valid record ID.] It will be "{!item.Id}" instead of "{item.Id}" notice ! <...


Only top voted, non community-wiki answers of a minimum length are eligible