<lightning:inputfield aura:id="mailadd" fieldname="MailingAddress"/>
I'm trying to update it in controller:
component.find('mailingadd').set('v.value',"what goes here?")
;
Component:
<lightning:recordEditForm aura:id="conRecordForm" objectApiName="Contact" onsubmit="{!c.contSubmitHandler}" onsuccess="{!c.redirecttoAccount}" onerror="{!c.conhandleErrors}" class="slds-hide" onload="{!c.updtConFields}">
<div class="slds-scrollable" style="height:25rem;width:auto">
<h3 class="slds-section-title--divider">Contact Information</h3>
<div class="slds-modal__content slds-p-around--medium slds-grid slds-wrap ">
<aura:iteration items="{!v.conFields}" var="conField">
<lightning:inputField aura:id="conflds" fieldName="{!conField}" class="slds-size--1-of-2 slds-p-horizontal_x-small"/>
</aura:iteration>
</div>
<h3 class="slds-section-title--divider">Address Information</h3>
<div class="slds-modal__content slds-p-around--medium slds-grid slds-wrap ">
<lightning:inputField aura:id="mailingadd" fieldName="MailingAddress" class="slds-size--1-of-2 slds-p-horizontal_x-small"/>
</div>
</div>
<div class="slds-modal__footer">
<lightning:button class="slds-m-top_small" label="Cancel" onclick="window.history.previous()"/>
<lightning:button class="slds-m-top_small" variant="brand" type="submit" label="Save" />
</div>
</lightning:recordEditForm>
Please be informed that I can only access using component.find because I'm accessing this form from another form onsubmit action in the same page.
My intention is to mimic the auto population of Account field values on contact when new contact is clicked from the related section of an account(standard functionality). I was able to update all other fields from account, but MailingAddress is weird and won't update. Maybe, because it contains several fields in itself.