• Sandeep Sahrawat
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
I have:
2 Lightning components
1 Lightning application (with dependency out)
2 Visualforce pages that host the lightning components through the lightning out application
What it does:
1 lightning component shows list of items and can redirect to the other lightning component showing more data for a particular item
The visualforce pages are there to have the functionality in classic UI
The situation:
Everything works in my DEV org where I create the managed package.
In other orgs the lightning components still work in Lightning Experience but when viewed in the Visualforce pages they don't show up anymore because of a syntax error:
VM429:1 Uncaught SyntaxError: Unexpected token w in JSON at position 0xhr.onreadystatechange @ lightning.out.delegate.js?v=qnVOSqP_GYth6AWC2fT1jQ:83

xhr.onreadystatechange = function() { if (xhr.readyState == 4 && xhr.status == 200) { var config = JSON.parse(xhr.responseText); // save the delegate version to local storage localStorage.lightningOutDelegateVersion = config.delegateVersion;

xhr.responsetext:

while(1);↵*/{"defaultHandler":"function() {$A.clientService.hardRefresh()}","event":{"descriptor":"markup://aura:noAccess","attributes":{"s":1,"v":{"values":{}}},"eventDef":{"s":2,"v":{"descriptor":"markup://aura:noAccess","type":"APPLICATION","xs":"G","superDef":{"s":3,"v":{"descriptor":"markup://aura:applicationEvent","type":"APPLICATION","xs":"G","attributes":{}}},"attributes":{"redirectURL":{"s":4,"v":{"name":"redirectURL","type":"aura://String","xs":"G"}}}}}},"exceptionEvent":true}/*ERROR*/

This clearly has to do with the lightning out functionality.
Everything was still working in other orgs before the last release.
I only added the handling of an application event in the visualforce pages so the handleNavUrl and the eventService part so that navigation events that in lightning experience are handled by the one.app are handled by the Visualforce container in classic UI.

<script> var handleNavToURL = function(event){ var theURL = event.getParam("url"); console.log('Got URL from component: ' + theURL); if (theURL.includes('/apex/')) { window.top.location.assign(theURL); } else { window.open(theURL, '_blank'); } }; $Lightning.use("MYNAMESPACE:MYLOAPP", function() { $Lightning.createComponent( "MYNAMESPACE:NewsFeed", { label : "NewsFeed", recordId : "{!account.id}", sObjectName : "Account", newsFeedCount : "4" }, "NewsFeed", function(cmp) { $A.eventService.addHandler({ "event": "force:navigateToURL", "handler" : handleNavToURL}) } ); }); </script>

I want to mention again that I don't have any problem at all in my own developer org.
It only gives a problem when it's packaged and installed in another org.
Anyone an idea?
1. I have used Salesforce Napili template to create a new Community. 
2. I have created a new page in this template where I am exposing a new Lightning Component I created. 
3. The lightning component accepts email and phone as two attributes. 
4. These attributes should be passed to the lightning component embedded in the community as URL parameters. I am not able to do this today. 
 
I would like to pass pass parameters to the lightning component inside community using URL parameter like: 
http://<<communityURL>>/<<communityName>>?&email=rama@test.org&phone=999-999-9999 
 
The email and phone parameters from the community URL should be passed to the component included in the community. 
 
I know a way of doing this through lightning applications. I have seen this link: 
http://salesforce.stackexchange.com/questions/106543/lightning-app-getting-url-parameter 
 
But, my usecase is different. I don't have a lightning application. I only have a lightning component embedded in a Salesforce Lightning Community.
 
Please suggest, if this can be done.
The salesforce service console is failing to timeout. Session timeout is set to 15 minutes and even after 15 minutes, session is still active. After doing research, i found out that one of the visualforce page is keeping the session alive bcoz @remoteaction annotation is being used.

http://salesforce.stackexchange.com/questions/5496/remote-actions-and-session-timeout-question 

http://salesforce.stackexchange.com/questions/106741/how-to-poll-data-without-resetting-the-session-clock 

What can be the workaround for this? Instead of @RemoteAction can i use actionfunction? 
1. I have used Salesforce Napili template to create a new Community. 
2. I have created a new page in this template where I am exposing a new Lightning Component I created. 
3. The lightning component accepts email and phone as two attributes. 
4. These attributes should be passed to the lightning component embedded in the community as URL parameters. I am not able to do this today. 
 
I would like to pass pass parameters to the lightning component inside community using URL parameter like: 
http://<<communityURL>>/<<communityName>>?&email=rama@test.org&phone=999-999-9999 
 
The email and phone parameters from the community URL should be passed to the component included in the community. 
 
I know a way of doing this through lightning applications. I have seen this link: 
http://salesforce.stackexchange.com/questions/106543/lightning-app-getting-url-parameter 
 
But, my usecase is different. I don't have a lightning application. I only have a lightning component embedded in a Salesforce Lightning Community.
 
Please suggest, if this can be done.