I am using the new Lightning:recordForm with a list of fields.
<lightning:recordForm
objectApiName="Account"
recordTypeId ="{!v.rtTypeId}"
fields="{!v.acctFields}"
columns="2"
mode="edit"
onload = "{!c.handleOnload}" />
One of the fields in the field list is BillingAddress, and it does correctly display the Billing Address fields as a compound address:
But as you will see, it doesn't default the value for Billing Country Code correctly. Looking in the onload logs, it is getting the value of US, just not the displayValue. I was thinking I could doing something like this in the onload and set the default, but it isn't working:
var response = event.getParams();
var fields = response.record.fields;
console.log(fields.BillingCountryCode.value); //US
console.log(fields.BillingCountryCode.displayValue); //null
fields.BillingCountryCode.displayValue = 'United States';//doesn't work
Anyone know how to either a) get the default to work, or b) set the displayValue to United States?