3

I am noticing strange behaviour in my lightning community in components that utilize <lightning:outputField/>. Basically, the DOM is not rendering any field data, although inspecting the area with the Chrome debugger shows that the tag is being rendered.

Environment

I verified that my production instance is not affected (and is running Summer '18). I refreshed a developer sandbox on Sept 10, 2018 and verified that it is running Winter '19. That sandbox and all other sandboxes running Winter '19 exhibit that behaviour.

Security

I am using <lightning:outputField/> in a lightning component that renders fields from the Case object in a lightning community. I encountered a similar error where my fields were not rendering because of certain FLS settings. I resolved that issue by ensuring that the profile for my community users had read access to all the fields I am displaying using the outputField tag, that the user has Read access to the Case record I am displaying and all fields are on the page layout for the record type of the Case being shown. The screenshot below showed what the DOM rendered in my previous error, and what it is doing now (even though I verified that my user has the correcet permissions to view the record and fields)

enter image description here

5
  • If you observe this behavior on all of your Winter '19 sandboxes, you may then like to open a Case for Salesforce Support.
    – Jayant Das
    Commented Sep 11, 2018 at 21:43
  • Yep I've just opened up a support case. I posted here because we're only a standard partner and I'm almost sure they're going to close my case because it's a developer or programmatic issue.
    – alecln
    Commented Sep 11, 2018 at 21:51
  • I have seen issues after upgrades and this could very well classify as a known issue. I though don't see this to be reported on the known issues so far, hopefully yours will make to the list if at all Salesforce confirms the behavior.
    – Jayant Das
    Commented Sep 11, 2018 at 21:52
  • if the case will not help, try aura:if and render the section if the Id of the record is not empty. There is an issue with input/output fields when using various view/edit forms when you try to render them and the record Id is not there yet thus it renders it empty but never rerenders when Id changes.
    – Paul
    Commented Sep 12, 2018 at 7:43
  • Thanks for the suggestion @Paul - I tried wrapping the entire lightning:recordViewForm tag in an aura:if to only render if the recordId is available but still encountering the same error.
    – alecln
    Commented Sep 12, 2018 at 21:22

1 Answer 1

0

After talking to Salesforce support, the issue was not due to the lightning:outputField tag itself, but the parent lightning:recordViewForm tag.

I had two issues in my existing implementation:

  1. the "objectApiName" attribute on lightning:recordViewForm was incorrectly spelled as "objectAPIName"

  2. I provided an invalid bound expression for that attribute {!objectAPIName} when it should have been {!v.objectAPIName}

What's interesting to note is that although these two bugs were present, the outputField tags worked as expected pre Winter '19. It only seems like in this upcoming release, the objectApiName attribute is actually being used in the lightning:recordViewForm tag.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .