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:
When I setting
<lightning:inputField value="{!v.contact.MailingAddress} fieldName="MailingAddress"/>
It's prepopulated, but I can't access updated values afterwards. Stringified component.find("mAddress").get("v.value") showing nulls everywhere.
When trying onload
let address = component.find("mAddress").get("v.value"); address["MailingCountryCode"] = "US"; component.find("mAddress").set("v.value", address);
Not prepopulating. But can access updated field value with component.find("mAddress").get("v.value").MailingCountryCode. Same if trying to set after loaded, even on button click.
- Find fields directly with querySelector - don't have access, maybe since it's on Partner Portal Community. By id - for compound Address each field id generated by Lightning, so I'm not sure if I can use them.
- Set up aura:attribute with type Address, ConnectedApi.Address, Object - also seems not working.
Is there some other way/option to prepopulate MailingAddress and get updated value on button click?