Skip to main content
added 5 characters in body; edited title
Source Link
Robs
  • 9.4k
  • 21
  • 119
  • 224

<lightning:recordViewForm will not display on Public Community Page

I have a <lightning:recordViewForm onin a public community pagecustom lightning component.

When I hardcode the recordId attribute it works, but when I pass an attribute in it fails without any error messages in either the console or the debug log.

Component

<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:attribute name="recordId" type="Id"></aura:attribute>
              
<lightning:recordViewForm recordId="{! v.recordId }" objectApiName="MyCustomObject__c">

    <lightning:outputField fieldName="Name" />

</lightning:recordViewForm>

JavaScript Controller

doInit : function(cmp, event, helper) {
       
    // var recordId = helper.getQueryStringParameter('recordId');
      
    cmp.set("v.recordId", "a0C4E000003YMkmUAG");
}

The above does not work, even if I put the recordId directly into the attribute.

The guest user permissions are fine, because it works when I hardcode the recordId attribute of the <lightning:recordViewForm

It only works when I set the Id in the recordId attribute of the <lightning:recordViewForm like below:

<lightning:recordViewForm recordId="a0C4E000003YMkmUAG" objectApiName="MyCustomObject__c">

    <lightning:outputField fieldName="Name" />

</lightning:recordViewForm>

<lightning:recordViewForm will not display on Public Community Page

I have a <lightning:recordViewForm on a public community page.

When I hardcode the recordId attribute it works, but when I pass an attribute in it fails without any error messages in either the console or the debug log.

Component

<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:attribute name="recordId" type="Id"></aura:attribute>
              
<lightning:recordViewForm recordId="{! v.recordId }" objectApiName="MyCustomObject__c">

    <lightning:outputField fieldName="Name" />

</lightning:recordViewForm>

JavaScript Controller

doInit : function(cmp, event, helper) {
       
    // var recordId = helper.getQueryStringParameter('recordId');
      
    cmp.set("v.recordId", "a0C4E000003YMkmUAG");
}

The above does not work, even if I put the recordId directly into the attribute.

The guest user permissions are fine, because it works when I hardcode the recordId attribute of the <lightning:recordViewForm

It only works when I set the Id in the recordId attribute of the <lightning:recordViewForm like below:

<lightning:recordViewForm recordId="a0C4E000003YMkmUAG" objectApiName="MyCustomObject__c">

    <lightning:outputField fieldName="Name" />

</lightning:recordViewForm>

<lightning:recordViewForm will not display

I have a <lightning:recordViewForm in a custom lightning component.

When I hardcode the recordId attribute it works, but when I pass an attribute in it fails without any error messages in either the console or the debug log.

Component

<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:attribute name="recordId" type="Id"></aura:attribute>
              
<lightning:recordViewForm recordId="{! v.recordId }" objectApiName="MyCustomObject__c">

    <lightning:outputField fieldName="Name" />

</lightning:recordViewForm>

JavaScript Controller

doInit : function(cmp, event, helper) {
       
    // var recordId = helper.getQueryStringParameter('recordId');
      
    cmp.set("v.recordId", "a0C4E000003YMkmUAG");
}

The above does not work, even if I put the recordId directly into the attribute.

It only works when I set the Id in the recordId attribute of the <lightning:recordViewForm like below:

<lightning:recordViewForm recordId="a0C4E000003YMkmUAG" objectApiName="MyCustomObject__c">

    <lightning:outputField fieldName="Name" />

</lightning:recordViewForm>
added 406 characters in body
Source Link
Robs
  • 9.4k
  • 21
  • 119
  • 224

I have a <lightning:recordViewForm on a public community page.

When I hardcode the recordId attribute it works, but when I pass an attribute in it fails without any error messages in either the console or the debug log.

Component

<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:attribute name="recordId" type="Id"></aura:attribute>
              
<lightning:recordViewForm recordId="{! v.recordId }" objectApiName="MyCustomObject__c">

    <lightning:outputField fieldName="Name" />

</lightning:recordViewForm>

JavaScript Controller

doInit : function(cmp, event, helper) {
       
    // var recordId = helper.getQueryStringParameter('recordId');
      
    cmp.set("v.recordId", recordId"a0C4E000003YMkmUAG");
}

The above does not work, even if I put the recordId directly into the attribute.

The guest user permissions are fine, because it works when I hardcode the recordId attribute of the <lightning:recordViewForm

It only works when I set the Id in the recordId attribute of the <lightning:recordViewForm like below:

<lightning:recordViewForm recordId="a0C4E000003YMkmUAG" objectApiName="MyCustomObject__c">

    <lightning:outputField fieldName="Name" />

</lightning:recordViewForm>

I have a <lightning:recordViewForm on a public community page.

When I hardcode the recordId attribute it works, but when I pass an attribute in it fails without any error messages in either the console or the debug log.

Component

<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:attribute name="recordId" type="Id"></aura:attribute>
              
<lightning:recordViewForm recordId="{! v.recordId }" objectApiName="MyCustomObject__c">

    <lightning:outputField fieldName="Name" />

</lightning:recordViewForm>

JavaScript Controller

doInit : function(cmp, event, helper) {
       
    var recordId = helper.getQueryStringParameter('recordId');
      
    cmp.set("v.recordId", recordId);
}

The guest user permissions are fine, because it works when I hardcode the recordId attribute of the <lightning:recordViewForm

I have a <lightning:recordViewForm on a public community page.

When I hardcode the recordId attribute it works, but when I pass an attribute in it fails without any error messages in either the console or the debug log.

Component

<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:attribute name="recordId" type="Id"></aura:attribute>
              
<lightning:recordViewForm recordId="{! v.recordId }" objectApiName="MyCustomObject__c">

    <lightning:outputField fieldName="Name" />

</lightning:recordViewForm>

JavaScript Controller

doInit : function(cmp, event, helper) {
       
    // var recordId = helper.getQueryStringParameter('recordId');
      
    cmp.set("v.recordId", "a0C4E000003YMkmUAG");
}

The above does not work, even if I put the recordId directly into the attribute.

The guest user permissions are fine, because it works when I hardcode the recordId attribute of the <lightning:recordViewForm

It only works when I set the Id in the recordId attribute of the <lightning:recordViewForm like below:

<lightning:recordViewForm recordId="a0C4E000003YMkmUAG" objectApiName="MyCustomObject__c">

    <lightning:outputField fieldName="Name" />

</lightning:recordViewForm>
Source Link
Robs
  • 9.4k
  • 21
  • 119
  • 224

<lightning:recordViewForm will not display on Public Community Page

I have a <lightning:recordViewForm on a public community page.

When I hardcode the recordId attribute it works, but when I pass an attribute in it fails without any error messages in either the console or the debug log.

Component

<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:attribute name="recordId" type="Id"></aura:attribute>
              
<lightning:recordViewForm recordId="{! v.recordId }" objectApiName="MyCustomObject__c">

    <lightning:outputField fieldName="Name" />

</lightning:recordViewForm>

JavaScript Controller

doInit : function(cmp, event, helper) {
       
    var recordId = helper.getQueryStringParameter('recordId');
      
    cmp.set("v.recordId", recordId);
}

The guest user permissions are fine, because it works when I hardcode the recordId attribute of the <lightning:recordViewForm