• Charlotte Gibson
  • NEWBIE
  • 30 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 8
    Replies
I'm trying to get a link on a VF page in SF1 to navigate to a Lightning component. I can do Lightning-component-to-Lightning-component navigation, and Lightning-component-to-VF page navigation, but I'm struggling with the JavaScript syntax for VF-to-Lightning-component navigation.

Here's my code snippet - the JS is basically taken from the component-to-component nav snippet (which works a treat when launced via a ui:button press attribute in a Lightning component):
<apex:page showHeader="true" sidebar="true">

<script>
    function navToPlotList(devId, devName){
      console.log('dev id: ' + devId);
      console.log('dev name: ' + devName);

          var button = $A.get("e.force:navigateToComponent");
          button.setParams({
            componentDef:"c:pb_plotList",
            componentAttributes: {
              devId: component.get("devId"),
              devName: component.get("devName")
            }

          });
          button.fire(); 
    }

</script>

<a href="#" onClick="navToPlotList('a06L000000GdS7X', 'TEST NAME')">Go to plot list</a>

I know that the issue right now is with the $A on line 8, but I'm not sure what to replace this with in order to get this working. Also I'm not sure whether the button.fire(); will even work from JS in a VF page. Any thoughts? Thanks in advance! :)
Hi folks,

I've got a custom object (issue__c) hanging off Standard Case, which has a VF page on edit only. Save the issue, and (in the browser at least) the code returns you to the parent case record via a pageReference method returning PageReference('/' + cas.id).

However, I've encountered that fun little bug where in the SF1 app, the custom save button redirects the user not to the standard SF1 case page, but to the page as it looks in a browser.

After a lot of snooping, I've done my first bit of JavaScript, called by an onclick action on my VF button, which checks whether we're in SF1 or not, and if so, theoretically returns us to the SF1 case layout. I'm having difficulty getting it to redirect, however. Here's a cut-down version of my VF page:

<apex:page standardController="Issue__c" extensions="IssuesController" tabStyle="Issue__c">
 
  <script>
  
    function backToCase() {
    if ((typeof sforce != 'undefined') && (sforce != null) ) {
     // in SF1
     console.log("here we're in sf1");
     var backToCaseURL = 'javascript:sforce.one.navigateToSObject({!cas.id})';
    } else {
     // not in Salesforce1

     console.log("here we're in \'standard\' SF");
     console.log('case id is: {!cas.id}');
     window.location.href='/{!cas.id}';
    }
    return false;
   }

  </script>
 
  <apex:form >
  
   <apex:sectionHeader title="{!if(issueId==null,'Create Issue','Edit Issue')}" subtitle="Case {!issue.case__r.caseNumber} - Issue {!issue.name}">
    <apex:pageBlock title="Issue">
     <apex:pageBlockButtons >
      <apex:commandButton value="Save" action="{!save}" onclick="backToCase();"/>
     </apex:pageBlockButtons>
    </apex:pageBlock>
   </apex:sectionHeader>
 
  
  </apex:form>
</apex:page>

The "save" code on my controller is just this - very simple, and the code is saving fine. My gut tells me that the issue's not here, but thought I'd include it just in case:

public void save(){
  
   if(isNewIssue){
    insert issue;
    system.debug('Inserting Record');
   } else{
    update issue;
    system.debug('Updating Record');
   
   }
  
   
}
Thoughts? I'm quite new to Javascript.

Has anyone seen this before? I went to deploy ONE visualforce page from Eclipse, and now it's deploying four components... out of THREE.

Also, the tests are taking forever - they've been running for almost an hour now, when they usually take 10 mins or so. I'm not panicing or anything, but just thought it was odd so decided to share, and see if anyone else has experienced something similar?

Mutant deployment
I'm trying to get a link on a VF page in SF1 to navigate to a Lightning component. I can do Lightning-component-to-Lightning-component navigation, and Lightning-component-to-VF page navigation, but I'm struggling with the JavaScript syntax for VF-to-Lightning-component navigation.

Here's my code snippet - the JS is basically taken from the component-to-component nav snippet (which works a treat when launced via a ui:button press attribute in a Lightning component):
<apex:page showHeader="true" sidebar="true">

<script>
    function navToPlotList(devId, devName){
      console.log('dev id: ' + devId);
      console.log('dev name: ' + devName);

          var button = $A.get("e.force:navigateToComponent");
          button.setParams({
            componentDef:"c:pb_plotList",
            componentAttributes: {
              devId: component.get("devId"),
              devName: component.get("devName")
            }

          });
          button.fire(); 
    }

</script>

<a href="#" onClick="navToPlotList('a06L000000GdS7X', 'TEST NAME')">Go to plot list</a>

I know that the issue right now is with the $A on line 8, but I'm not sure what to replace this with in order to get this working. Also I'm not sure whether the button.fire(); will even work from JS in a VF page. Any thoughts? Thanks in advance! :)
I have a visuaforce page which opens from a Lightning component (not lightning app). Now, I want to redirect my user to another Lightning component from this visualforce page but not able to do so, I have used sforce.one.navigateToURL and window.location but nothing worked. Any way to achieve this?
  • April 28, 2015
  • Like
  • 0
Hi folks,

I've got a custom object (issue__c) hanging off Standard Case, which has a VF page on edit only. Save the issue, and (in the browser at least) the code returns you to the parent case record via a pageReference method returning PageReference('/' + cas.id).

However, I've encountered that fun little bug where in the SF1 app, the custom save button redirects the user not to the standard SF1 case page, but to the page as it looks in a browser.

After a lot of snooping, I've done my first bit of JavaScript, called by an onclick action on my VF button, which checks whether we're in SF1 or not, and if so, theoretically returns us to the SF1 case layout. I'm having difficulty getting it to redirect, however. Here's a cut-down version of my VF page:

<apex:page standardController="Issue__c" extensions="IssuesController" tabStyle="Issue__c">
 
  <script>
  
    function backToCase() {
    if ((typeof sforce != 'undefined') && (sforce != null) ) {
     // in SF1
     console.log("here we're in sf1");
     var backToCaseURL = 'javascript:sforce.one.navigateToSObject({!cas.id})';
    } else {
     // not in Salesforce1

     console.log("here we're in \'standard\' SF");
     console.log('case id is: {!cas.id}');
     window.location.href='/{!cas.id}';
    }
    return false;
   }

  </script>
 
  <apex:form >
  
   <apex:sectionHeader title="{!if(issueId==null,'Create Issue','Edit Issue')}" subtitle="Case {!issue.case__r.caseNumber} - Issue {!issue.name}">
    <apex:pageBlock title="Issue">
     <apex:pageBlockButtons >
      <apex:commandButton value="Save" action="{!save}" onclick="backToCase();"/>
     </apex:pageBlockButtons>
    </apex:pageBlock>
   </apex:sectionHeader>
 
  
  </apex:form>
</apex:page>

The "save" code on my controller is just this - very simple, and the code is saving fine. My gut tells me that the issue's not here, but thought I'd include it just in case:

public void save(){
  
   if(isNewIssue){
    insert issue;
    system.debug('Inserting Record');
   } else{
    update issue;
    system.debug('Updating Record');
   
   }
  
   
}
Thoughts? I'm quite new to Javascript.

Has anyone seen this before? I went to deploy ONE visualforce page from Eclipse, and now it's deploying four components... out of THREE.

Also, the tests are taking forever - they've been running for almost an hour now, when they usually take 10 mins or so. I'm not panicing or anything, but just thought it was odd so decided to share, and see if anyone else has experienced something similar?

Mutant deployment

 

Hi, 
When creating a simple class (or trigger) CheckEmail using the EmailMessage object with the method

public class CheckEmail {
   public static void HandleEmailMessages(List<EmailMessage> emailMessageList){
 
    }
}


this class works fine functionally, however can not be moved using the Migration tool or Change sets to my next sandbox.

The error received is:

CheckEmail
Apex Class
1
8

Entity is not org-accessible
 
Does anybody have any clue why this class does not transport?

Thx
Guy