• KristofferGreene
  • NEWBIE
  • 35 Points
  • Member since 2015
  • Developer


  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 6
    Replies
How do you call a function in the controller/click a button when the user presses the enter key? I have a form with a submit button, all inside the same component. Thanks!
So went through the Lighting Connect Trailhead, and everything works fine.  I can connect to the test database, and I connected the Orders__x object to the Account object.

So I figure let's test it out in visualforce but that's where I started running into trouble.  I figure to start, I would do a real simple test somethign like the following
<apex:page standardController="Orders__x">

  <apex:detail />

 
</apex:page>

and I used the externalId as my connector
https://c.na16.visual.force.com/apex/phonepage?ExternalId=1001

But it's not working.  Any ideas?

Thanks,

 
How do you call a function in the controller/click a button when the user presses the enter key? I have a form with a submit button, all inside the same component. Thanks!
I don't see a Setup menu to run the Lightning App Builder for a challange.  I'm using the Summer `15 Developer Edition.  How is it enabled? 
I referenced the documentation on writing debug messages to console.  Docs had this pattern for logging:
({
	actionFunction : function(component, event, helper) {
           $A.logger.subscribe("INFO", logCustom);
           $A.log("some message about function");

    	   //  code to perform action function here

           //helper methods 
           function logCustom(level, message, error) {
              console.log(getTimestamp(), "logCustom: ", arguments); 
    	   }
    	
           function getTimestamp() {
              return new Date().toJSON();
    	   }        
	}
})
This is fine.  But, I've got several functions in my controller and I don't want to cut and paste logCustom() and getTimeStamp() into every controller action.  Nor, do I want to have to initialize the logger by calling $A.logger.subscribe(...) in every method call.  This seems like something for Helper.  My initial attempt was to move logCustom() and getTimeStamp() from the Controller function to Helper and then just call
$A.logger.subscribe("INFO", helper.logCustom);

within the body of the controller action.  After doing this my component stopped working.  No log message in the Chrome developer console.  No log in the Force.com Developer Console to indicate an error.

Two questions:
What did I miss here regarding the appropriate use the the Helper within the framework?
Where else should I look for error messages to see why controller code is not executing?

Thanks