1

I'm having a custom lookup input field in my custom lightning component. When I select a contact from that lookup, it should display its related account field values like account name, account type and account shipping address fields(street, country, state, postal code and state).

Account name and account type are displaying correctly whereas address field always shows empty though it has it's own values in the corresponding account.

<c:CustomLookup objectAPIName="Contact" selectedRecord="{!v.selectedContact}" SearchKeyWord="{!v.contactKeyWord}" label="Contact" required="true" />
  <lightning:input name = "Street" value = "{!v.selectedContact.Account.ShippingStreet}" label = "Street"/>
  <lightning:input name = "Country" value = "{!v.selectedContact.Account.ShippingCountry}" label = "Street"/>
  <lightning:input name = "State" value = "{!v.selectedContact.Account.ShippingState}" label = "Street"/>
  <lightning:input name = "Name" value = "{!v.selectedContact.Account.Name}" label = "Street"/>

I'm surprised here that it's not displaying only the address fields whereas non-address fields are displayed properly. Also I checked that we can display the address field info using "lightning:inputAddress".

So my question here is, is there any chance to display the address fields using lightning:input or should we go only for "lightning:inputAddress"

1
  • Can you check what you are getting from server? Maybe in the network tab which is available when you open Developer Console of browser. – itzmukeshy7 Apr 2 '20 at 11:31
1

I deleted cookies from the browser settings. Logged out from salesforce and then logged in. And tried, it displayed correctly. I seriously don't know why.

Though it sounds weird, it worked for me. Thanks all, for your time.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.