• guppster01
  • NEWBIE
  • 5 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
First time using Components - putting it in a VisualForce page to leverage on a Force.com Site. The Component works just find on the VF page accessing when logged in (https://mydomain/apex/Testpage). However, when trying to access the page via a Site, it doesn't show up, and shows an error like: An Internal Server Error has occurred (see image) 
What VF Paged Looks like via Site
The page permissions themselves work just fine. I include a <p> tag on the page and it displays along with the error. 

Are there special permissions needed for the components in some way to display the component on the VF page via a Force.com Site?

Page Code
<apex:page showHeader="false" standardStylesheets="false">
   <apex:includeLightning/>
    <div id="lightning" />

    <script>
        $Lightning.use("c:TestApp", function() {
         $Lightning.createComponent("c:ContactExample",{},"lightning", function(cmp) {});

        });
    </script>
    <p>Test page 1</p>
</apex:page>
App Code
<aura:application access="GLOBAL" extends="ltng:outApp" implements="ltng:allowGuestAccess" >
<aura:dependency resource="c:ContactExample"/>		

</aura:application>
Component Code
<aura:component controller="dataTableController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global">
    
    <aura:attribute name="searchTerm" type="Map" default="{'name':''}"/>
    
    <aura:registerEvent name="contactSearchComplete" type="c:contactSearchEvent"/>
    
	<lightning:input type="Text" label="Enter Contact Name" aura:id="searchTerm" value="{!v.searchTerm.name}"/>
    
	<lightning:button label="Search" onclick="{!c.doSearch}" />
    
</aura:component>



 
I have a test class that works in my Developement Sandbox but doesn't work when Validating the Change Set in Production.

We have a Partner Community, and the test class creates a user with a Partner Community Role and Partner Profile.  Here is the User Creation Test code that is failing on Insert:
public static User getCommunityUser(Profile p, String contactId)
    {
        User testUser = new User();
        String rId = [SELECT ID FROM USERROLE WHERE NAME Like 'Partner Test - Big Dealer Partner User%' LIMIT 1].Id;
        

        testUser.Email = 'test@test.com';
        testUser.Username = '2345666@testuser.com';
        testUser.LastName = 'test';
        testUser.Alias = 'test';
        if (p != null)
         {
            testUSer.ProfileId = p.Id;
         }
         else
         {
            testUser.ProfileId = UserInfo.getProfileId();
         }
        testUser.LanguageLocaleKey = 'en_US';
        testUser.LocaleSidKey = 'en_US';
        testUser.TimeZoneSidKey = 'America/Chicago';
        testUser.EmailEncodingKey = 'UTF-8';
        testUser.ContactId = contactId;
        testUser.UserRoleId = rId;
        testUser.IsActive = true;

         insert testUser;  
         
         return testUser;
    }
This works in the Dev environments. 
The error when Validating in Production is this: 
User-added image
I have confirmed the Roles and Profiles exist in Production. Also confirmed I do have available licenses for the Community. I'm guessing there is a nuance with Partner Community Roles that I don't know about. 

Ideas? Answers? :) Thanks Community!
 
First time using Components - putting it in a VisualForce page to leverage on a Force.com Site. The Component works just find on the VF page accessing when logged in (https://mydomain/apex/Testpage). However, when trying to access the page via a Site, it doesn't show up, and shows an error like: An Internal Server Error has occurred (see image) 
What VF Paged Looks like via Site
The page permissions themselves work just fine. I include a <p> tag on the page and it displays along with the error. 

Are there special permissions needed for the components in some way to display the component on the VF page via a Force.com Site?

Page Code
<apex:page showHeader="false" standardStylesheets="false">
   <apex:includeLightning/>
    <div id="lightning" />

    <script>
        $Lightning.use("c:TestApp", function() {
         $Lightning.createComponent("c:ContactExample",{},"lightning", function(cmp) {});

        });
    </script>
    <p>Test page 1</p>
</apex:page>
App Code
<aura:application access="GLOBAL" extends="ltng:outApp" implements="ltng:allowGuestAccess" >
<aura:dependency resource="c:ContactExample"/>		

</aura:application>
Component Code
<aura:component controller="dataTableController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global">
    
    <aura:attribute name="searchTerm" type="Map" default="{'name':''}"/>
    
    <aura:registerEvent name="contactSearchComplete" type="c:contactSearchEvent"/>
    
	<lightning:input type="Text" label="Enter Contact Name" aura:id="searchTerm" value="{!v.searchTerm.name}"/>
    
	<lightning:button label="Search" onclick="{!c.doSearch}" />
    
</aura:component>



 
I have a test class that works in my Developement Sandbox but doesn't work when Validating the Change Set in Production.

We have a Partner Community, and the test class creates a user with a Partner Community Role and Partner Profile.  Here is the User Creation Test code that is failing on Insert:
public static User getCommunityUser(Profile p, String contactId)
    {
        User testUser = new User();
        String rId = [SELECT ID FROM USERROLE WHERE NAME Like 'Partner Test - Big Dealer Partner User%' LIMIT 1].Id;
        

        testUser.Email = 'test@test.com';
        testUser.Username = '2345666@testuser.com';
        testUser.LastName = 'test';
        testUser.Alias = 'test';
        if (p != null)
         {
            testUSer.ProfileId = p.Id;
         }
         else
         {
            testUser.ProfileId = UserInfo.getProfileId();
         }
        testUser.LanguageLocaleKey = 'en_US';
        testUser.LocaleSidKey = 'en_US';
        testUser.TimeZoneSidKey = 'America/Chicago';
        testUser.EmailEncodingKey = 'UTF-8';
        testUser.ContactId = contactId;
        testUser.UserRoleId = rId;
        testUser.IsActive = true;

         insert testUser;  
         
         return testUser;
    }
This works in the Dev environments. 
The error when Validating in Production is this: 
User-added image
I have confirmed the Roles and Profiles exist in Production. Also confirmed I do have available licenses for the Community. I'm guessing there is a nuance with Partner Community Roles that I don't know about. 

Ideas? Answers? :) Thanks Community!