1

When a lightning inputfield is used on a picklist field, if the recordId is provided dynamically (through onchange handler event for example), the inputfield isn't filled with the value of the record

Code :

{!v.sObjId}
<lightning:recordEditForm aura:id="someId" recordId="{!v.sObjId}" objectApiName="Object__c">
    <lightning:inputField aura:id="someId2" fieldName="language_Document__c"/> 
    <lightning:outputField fieldName="language_Documents__c"/>
</lightning:recordEditForm>

Result : result of lightning inputfield

Any idea on how to solve this ?

  • I tried with your code and it was working for me, below is the snippet which I tried: <lightning:recordEditForm aura:id="recordEditForm" objectApiName="Contact" recordId="0037F00000gWFc7QAG"> <lightning:messages /> <lightning:inputField aura:id="level" fieldName="Level__c" /> <lightning:outputField fieldName="Level__c"/> </lightning:recordEditForm> – salesforce Developer Aug 2 '18 at 10:13
  • It's working when the id is provided statically. If I try to set it with an event, there seems to be a problem... I'll edit the question in a few moments – Simon Govaert Aug 2 '18 at 11:19
  • please add your complete component code – Itai Shmida Aug 7 '18 at 6:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.