• Sajiv Kartha 3
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 11
    Replies
Hi,

I need to extract the Workflows Rules into an excel.  The fields required are 
                 Rule Name, Object Name, Evaluation Criteria, Description, Rule Criteria
Is there anyway to get this ?

thanks
Sajiv
Hi

I copied a component from Salesforce tutorial (Expense Component example) to the Developer Console.  I am trying to integrate Sublime to get these.  However, when I refresh, I am not able to get these component related files.

The only two files that have got downloaded related to the expense component to the local sublime are  - ExpenseController.cls and TestExpenseController.cls.

There are other pages which I have created like vf page and these have got refreshed to the local sublime

Any clues on how I can download the files to my local sublime.  This will help a lot.  
Note: We use Mavensmate.  In the Mavensmate settings section, I see these lines : Should I change this to get the value in Subllime ?
 
Default metadata subscription (mm_default_subscription)
Array of metadata types that should be included in every new MavensMate project, e.g. ApexClass, ApexPage, CustomObject, StaticResource
[
  "ApexClass",
  "ApexComponent",
  "ApexPage",
  "ApexTrigger",
  "StaticResource"
]

Thanks
Sajiv
 
This is sporadic.  At times it works and at times it just throws the error attached.

User-added image
If I directly go to the Report Menu, it works just fine even in iPad.  

Is there anything that I am missing..  I irony is that we have similar links for other standard objects and they are all working fine.  It is only for the link to the Report tab it is not working

Report.SObjectType.getDescribe().getKeyPrefix()).getUrl()

There is no issue for these following standard object urls

Account.SObjectType.getDescribe().getKeyPrefix()).getUrl()
Contact.SObjectType.getDescribe().getKeyPrefix()).getUrl()

Thanks
Sajiv



 
Hi, 

Some questions with respect to the Report module.  Here is a report that we have and it has the relationship like this.

Levels for the Reports

Question : In the above screenshot on the top it shows Opportunities (A). The other three are relationships are below that.
Can we have another relationship like Opportunities to a new relationship (E) and E is not related to B or C or D.   We need this new relationship for our project. Need to explore if this is possible or we have to do only by means of development ? 

Thanks
Sajiv​


 
Hi,

When an approval is done by a user, the approval date takes the user's system date and updates the table.
Can I know how to get the salesforce server's date to update.

Thanks
Sajiv
I have an email template.  For an approval, this gets triggered and is sent to the approver.
When the approver receives a mail, he/she has just click on 'Reply' and type the 'Approve' or 'Reject' and then send. 

Here is the template.   I have put my question after the template.
---------------------------------------------------------------------------------------------------
An analysis for <a href="/{{opportunityid}}" id="{{approvalId}}-{{approvalRoleId}}">{{opportunityname}}</a> is in your queue for Approval. <br/>
<br/>
Comments from {{OppOwner}}:
{{OppOwnercomments}}<br/>
<br/>
To approve or reject this proposal either log into <a href="/apex/ApprovalQueue">Salesforce</a> or reply to this email. To respond via email, please type the word <b>"Approve"</b> or <b>"Reject"</b> as the first word in the first line in your reply.  To include comments, include them on a new line under your decision.
<br/>
---------------------------------------------------------------------------------------------------------
The issue  now is this :  Please refer this line in the above template
An analysis for <a href="/{{opportunityid}}" id="{{approvalId}}-{{approvalRoleId}}">{{opportunityname}}</a> is in your queue for Approval. <br/>

In Outlook 2016, the dynamic values id="{{approvalId}}-{{approvalRoleId}}"   is not getting appended.  It is getting ignored.  Thereby whenever the user receives the mail and tries to approve, it goes to the exception 

The template works fine on Gmail or Outlook 2013 or previous versions. It is only in Outlook 2016 we have the issue.

Any suggestions ?

Thanks
Sajiv


 
We have an Email Response feature.  The user receives a mail in their inbox and they can just click on Reply, type the word 'Approve' or 'Reject' and send it.

Now, this is working perfectly well on Outlook 2010 versions.  After the automatic upgrade to Outlook 2016, the Reply mails are all getting routed to exceptons.  Any clues on why this issue occurs.  We tried putting in debug statements, but are unable to specifically point the error.

This works fine on the webmail versions of Oulook 2016, but NOT on the Outlook application that is there on the desktops of the users.
Since majority of the users have migrated to the new Outlook 2016, we need to fix it.  Here is the code.

global class LeaseApproval_EmailResponseHandler implements Messaging.InboundEmailHandler {
    
    global Messaging.InboundEmailResult handleInboundEmail(Messaging.inboundEmail email,
                                                                Messaging.InboundEnvelope env) {
 
        // Create an InboundEmailResult object for returning the result of the
        // Apex Email Service
        Diagnostics.push('Approval email service');
        Messaging.InboundEmailResult result = new Messaging.InboundEmailResult();
        String myPlainText= '';
        String myHTMLText= '';
        myPlainText = email.plainTextBody;
        myHTMLText = email.htmlBody;
        Schema.DescribeSObjectResult opr = Opportunity.sObjectType.getDescribe();
        String oppPrefix = opr.getKeyPrefix();
        integer oppIdStartPos = myPlainText.indexOf(oppPrefix);
        String oppIdStr = myPlainText.subString(oppIdStartPos, oppIdStartPos+15);
        system.debug(oppIdStr);
        Id oppId = id.valueOf(oppIdStr);
        try{
            
            //we need to get the first word of text, check if it's "Approved" or "Rejected", then parse the comments before the first <hr/> tag
            integer firstSpace = myPlainText.indexOf('\n');
            String decisionStr = myPlainText.substring(0,firstSpace);
            system.debug(decisionStr);
            integer commentEnd = myPlainText.indexOf('\n\n');
            String comments = myPlainText.substring(firstSpace, commentEnd);
            

            Schema.DescribeSObjectResult ar = Lease_Approval_Role__c.sObjectType.getDescribe();
            String approvalPrefix = ar.getKeyPrefix();
            System.debug(approvalPrefix);
            integer idStartPos = myHTMLText.indexOf(approvalPrefix);
            String approvalIdStr = myHTMLText.subString(idStartPos, idStartPos+15);
            system.debug(approvalIdStr);
            Id approvalId = id.valueOf(approvalIdStr);

            //we need to find the id that should be in a hidden div in the origional email text
            Lease_Approval_Role__c existing = [Select Id, Comments__c, User__c from Lease_Approval_Role__c where ID = : approvalId];
            if(!(comments.trim()==''||comments.trim()==null)){
                existing.Comments__c = comments.trim();
            }
            String newStatus;
            if(!(decisionStr.equalsIgnoreCase('approved')||decisionStr.equalsIgnoreCase('rejected')||decisionStr.equalsIgnoreCase('reject')||decisionStr.equalsIgnoreCase('approve')||decisionStr.equalsIgnoreCase('nfw'))){
                //invalid response
                sendInvalidEmailNotification(email, oppId);
                system.debug('Bad Response' + decisionStr);
            }
            else if(decisionStr.equalsIgnoreCase('approved')||decisionStr.equalsIgnoreCase('approve')){
                newStatus = 'Approved';
            }
            else if(decisionStr.equalsIgnoreCase('rejected')||decisionStr.equalsIgnoreCase('reject')||decisionStr.equalsIgnoreCase('nfw')){
                newStatus = 'Rejected';
            }
            existing.Status__c = newStatus;
            if(newStatus=='Approved'){
                //try and get the user to set
                try{
                    system.debug('From: ' + email.fromAddress);
                    User approvedBy = [Select Id from User where Email = :email.fromAddress and isActive = true limit 1];
                    existing.Approved_By__c = approvedBy.Id;
                }
                catch(QueryException e){
                    //what are we to do?
                    existing.Approved_By__c = existing.User__c;
                    system.debug(e.getMessage() + ' ' + e.getStackTraceString());
                }
                existing.Submitted_Date__c = system.today();
            }
            else if(newStatus=='Rejected'){
                //try and get the user to set
                try{
                    system.debug('From: ' + email.fromAddress);
                    User approvedBy = [Select Id from User where Email = :email.fromAddress and isActive = true limit 1];
                    existing.Rejected_By__c = approvedBy.Id;
                }
                catch(QueryException e){
                    //what are we to do?
                    existing.Rejected_By__c = existing.User__c;
                    system.debug(e.getMessage() + ' ' + e.getStackTraceString());
                }
                existing.Submitted_Date__c = system.today();
            }
            update existing;
            result.success = true;
            return result;
        }
        catch(Exception e){
            sendInvalidEmailNotification(email, oppId);
            system.debug('Exception: ' + e.getMessage() + e.getStackTraceString());
            result.success = false;
            return result;
        }
    }

    public static void sendInvalidEmailNotification(Messaging.inboundEmail badEmail, Id opportunityId){
        Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();

        Opportunity relatedOpp = [Select Id, Name from Opportunity where Id = : opportunityId];
        //email.setToAddresses(new List<String>{'jimmy@redpointsolutions.com'});
        email.setToAddresses(new List<String>{badEmail.fromAddress});
        email.setReplyTo('noreply@prologis.com');
        email.setSubject('ERROR - Invalid Reply for ' + relatedOpp.Name);
        String body = 'Your email reply for <a href="'+relatedOpp.Id+'">'+relatedOpp.Name+'</a> did not send due to invalid inputs.  <b>Do not reply to this email.</b>  Please reply again to the Approval Request email using the correct format.  Please type the word Approve or Reject as the first word in the first line of your reply.  To include comments, hit “return” after your response, and type any comments starting on the second line of your reply.';
        email.setHTMLBody(body);
        system.debug('Email? '+email);
        Messaging.sendEmail(new List<Messaging.SingleEmailMessage>{email});
    }
}

 
I have an Excel Template, where the data needs to be shown from multiple queries that is running on a single query Id.  The query works fine in the Query Editor in Salesforce.  I am able ot see the object values also in the Template Builder and map the fields.   However, when I run the report, it does not show the output in a proper format.  Here is the query.  I have put my further questions after this query as well for what I need. Pls look into tht as well :-)

Here is the query
----------------------------------------------
Select id, Market__r.name,submarket__r.Name, 
(Select id, Land_Source__c, Land_Name__c, Land_Area__c from CDP_Land_Strategy__r), 

(Select id, Customer__r.Name, Customer__r.Account_Subtype__c, Customer__r.Owner.Name  From CDP_Asset_Customer_Accounts__r), 

Deal__c, Deal__r.Total_Building_NRA_SQF__c, Deal__r.stage__c,  
Deal__r.Description__c from cdp_asset__c where 
Deal__r.Type__c = 'XYZ' ORDER BY submarket__r.Name

------------------------

In the primary object query, it returns 9 rows which is fine.  The second query returns only 2 rows and the third around 5 rows as data in these tables are not mandatory.  

When the report gets generated, the output from the first query shows the 9 rows which is fine.  The output from the second query updates the top two rows (as it has only two rows).  Actually these two rows are not related to the first two lines.  They are related to the 5th  and 7th row.  Similar is the output for the third query.

Is there any help on what direction I need to take ?

Thanks
Sajiv 
In the new Summer 16 release, our sandboxes got updated last week (7/8 May 2016).

We find that the Opportunity Team Member table - OpportunityAccessLevel field gets updated with 'Read' only for the Owner (the person who creates the opportunity).  This is strange, because prior to the release, it was getting saved with 'All'

Does anyone have a similar issue ? And What is the solution ?
Hi,

For some custom objects, the classic view shows the error messages in proper format, whereas in Lightning it just shows distorted.  Can anyone provide an answer as to what needs to get done to show neat error messages in Lightning ?

Thanks
Sajiv
Hi,

We have a custom record type page. For the Classic version, it works very good. When we switch over to the lightning version the page shows only in classic mode and not in Lightning view.  

Can someone let us know what we need to do to show the page in Lightning  mode ?

Thanks
Sajiv
 
Hi, I need help. I seem to have decently followed the steps of creating a lighting component. I have a page that has links and these links have to be shown specific to user profile.  I am trying all these through a helloWorld component... I am using Chrome.

I have created an apex class, that has just one method : Here it goes.

(1) Apex Class
------------------
public with sharing class helloWorldApex {

       @AuraEnabled
 public String getCurrentUserProfile()
    {
        System.debug('Invoking helloWorldApex class-------------------');
        System.debug('User Id is --------'+UserInfo.getUserId());
        System.debug('User Name is --------'+UserInfo.getFirstName()) ;
        User currentUser = [SELECT Profile.Name FROM User WHERE Id = :UserInfo.getUserId() ];
        String userProfile=currentUser.Profile.Name;
        
        if( currentUser.Profile.Name == 'System Administrator' ){
            System.debug('User does have the System Administrator Access----------');
            
        }
     return userProfile;   
    }
}
Executing ths class is fine in the Debug Console and the User Id and name do get printed in the logs.

Now, I am trying to access this method getCurrentUserProfile() from the component.
Here is my component code. It is named as 

(2) helloWorld.cmp
-----------------------
<aura:component implements="force:appHostable" controller="helloWorldApex">
    <h1>Quick Create Links</h1>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

     <ui:outputText value="Your Profile is: "/>
     <ui:outputText value="{!v.currentUserProfile}"/>

< !-- Further here I see if the user profile has got specific profile and should show the links accordingly--> 
</aura:component>

(3) Here is the controller - helloWorldController.js

({
  doInit : function(component, event, helper) {
        debugger; //This does NOT get fired. Not sure why
        alert('doInit function invoked');  //this is getting fired in the browser.. 
    
       var action = component.get("c.getCurrentUserProfile"); //When control comes here, it throws an error in the browser ("Something has gone wrong. Cannot read property '$getActionDef$' of undefined. Please try again")

       alert('2');//this is not getting invoked
       action.setCallback(this, function(response) {
        var state=response.getState();
      alert();
      component.set("v.currentUserProfile", a.getReturnValue());
      });
    $A.enqueueAction(action);
   },
  
})

Can anyone tell me what I am missing ?

Thanks
Sajiv
 

 
Can I create a lightning page with simple html contents. The side bar is no longer available in the lightning mode.  The client is fine with showing links on the page instead of buttons.  

I need to show these links based on some conditions.  People with some profiles should not have access to some sections.  

Thanks
I am new to Salesforce. One of the requirement by my client is to make all the items available on classic mode to be available on lightning mode as well.

Now, we have a sidebar that has links to the system.  This sidebar is not visible in the  lightning mode.  Will it be available for the Spring 16 release and if yes, any clues on how I can get it ?
Hi.

We have customized the Oppurtunity page and it is fine in the classic version.  Now, the lightning has enabled and we had a lot of issues.  One particular issue that still not fixed is this.

While saving an opportunity, in the classic mode, it redirects to the classif view and that is fine.  No issues in this
But, when we switch to Lightning and then save an opportunty it redirects to the classic view.

The URLS in both these are different.  While we are fine about controlling whatever is there for the classic mode, it is not clear about how to control for the lightning mode.

Here is the classic url
https://port--sendilc.cs11.visual.force.com
Here is the lightning url
https://port--sendilc.lightning.force.com/one/one.app?source=aloha#/

However, the code is in the same place. 

We are trying to see how to get this working.. 

Could someone help pls...

Thanks
Sajiv, Chennai






 
Hi, I need help. I seem to have decently followed the steps of creating a lighting component. I have a page that has links and these links have to be shown specific to user profile.  I am trying all these through a helloWorld component... I am using Chrome.

I have created an apex class, that has just one method : Here it goes.

(1) Apex Class
------------------
public with sharing class helloWorldApex {

       @AuraEnabled
 public String getCurrentUserProfile()
    {
        System.debug('Invoking helloWorldApex class-------------------');
        System.debug('User Id is --------'+UserInfo.getUserId());
        System.debug('User Name is --------'+UserInfo.getFirstName()) ;
        User currentUser = [SELECT Profile.Name FROM User WHERE Id = :UserInfo.getUserId() ];
        String userProfile=currentUser.Profile.Name;
        
        if( currentUser.Profile.Name == 'System Administrator' ){
            System.debug('User does have the System Administrator Access----------');
            
        }
     return userProfile;   
    }
}
Executing ths class is fine in the Debug Console and the User Id and name do get printed in the logs.

Now, I am trying to access this method getCurrentUserProfile() from the component.
Here is my component code. It is named as 

(2) helloWorld.cmp
-----------------------
<aura:component implements="force:appHostable" controller="helloWorldApex">
    <h1>Quick Create Links</h1>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

     <ui:outputText value="Your Profile is: "/>
     <ui:outputText value="{!v.currentUserProfile}"/>

< !-- Further here I see if the user profile has got specific profile and should show the links accordingly--> 
</aura:component>

(3) Here is the controller - helloWorldController.js

({
  doInit : function(component, event, helper) {
        debugger; //This does NOT get fired. Not sure why
        alert('doInit function invoked');  //this is getting fired in the browser.. 
    
       var action = component.get("c.getCurrentUserProfile"); //When control comes here, it throws an error in the browser ("Something has gone wrong. Cannot read property '$getActionDef$' of undefined. Please try again")

       alert('2');//this is not getting invoked
       action.setCallback(this, function(response) {
        var state=response.getState();
      alert();
      component.set("v.currentUserProfile", a.getReturnValue());
      });
    $A.enqueueAction(action);
   },
  
})

Can anyone tell me what I am missing ?

Thanks
Sajiv
 

 
This is sporadic.  At times it works and at times it just throws the error attached.

User-added image
If I directly go to the Report Menu, it works just fine even in iPad.  

Is there anything that I am missing..  I irony is that we have similar links for other standard objects and they are all working fine.  It is only for the link to the Report tab it is not working

Report.SObjectType.getDescribe().getKeyPrefix()).getUrl()

There is no issue for these following standard object urls

Account.SObjectType.getDescribe().getKeyPrefix()).getUrl()
Contact.SObjectType.getDescribe().getKeyPrefix()).getUrl()

Thanks
Sajiv



 
Hi, 

Some questions with respect to the Report module.  Here is a report that we have and it has the relationship like this.

Levels for the Reports

Question : In the above screenshot on the top it shows Opportunities (A). The other three are relationships are below that.
Can we have another relationship like Opportunities to a new relationship (E) and E is not related to B or C or D.   We need this new relationship for our project. Need to explore if this is possible or we have to do only by means of development ? 

Thanks
Sajiv​


 
Hi,

When an approval is done by a user, the approval date takes the user's system date and updates the table.
Can I know how to get the salesforce server's date to update.

Thanks
Sajiv
We have an Email Response feature.  The user receives a mail in their inbox and they can just click on Reply, type the word 'Approve' or 'Reject' and send it.

Now, this is working perfectly well on Outlook 2010 versions.  After the automatic upgrade to Outlook 2016, the Reply mails are all getting routed to exceptons.  Any clues on why this issue occurs.  We tried putting in debug statements, but are unable to specifically point the error.

This works fine on the webmail versions of Oulook 2016, but NOT on the Outlook application that is there on the desktops of the users.
Since majority of the users have migrated to the new Outlook 2016, we need to fix it.  Here is the code.

global class LeaseApproval_EmailResponseHandler implements Messaging.InboundEmailHandler {
    
    global Messaging.InboundEmailResult handleInboundEmail(Messaging.inboundEmail email,
                                                                Messaging.InboundEnvelope env) {
 
        // Create an InboundEmailResult object for returning the result of the
        // Apex Email Service
        Diagnostics.push('Approval email service');
        Messaging.InboundEmailResult result = new Messaging.InboundEmailResult();
        String myPlainText= '';
        String myHTMLText= '';
        myPlainText = email.plainTextBody;
        myHTMLText = email.htmlBody;
        Schema.DescribeSObjectResult opr = Opportunity.sObjectType.getDescribe();
        String oppPrefix = opr.getKeyPrefix();
        integer oppIdStartPos = myPlainText.indexOf(oppPrefix);
        String oppIdStr = myPlainText.subString(oppIdStartPos, oppIdStartPos+15);
        system.debug(oppIdStr);
        Id oppId = id.valueOf(oppIdStr);
        try{
            
            //we need to get the first word of text, check if it's "Approved" or "Rejected", then parse the comments before the first <hr/> tag
            integer firstSpace = myPlainText.indexOf('\n');
            String decisionStr = myPlainText.substring(0,firstSpace);
            system.debug(decisionStr);
            integer commentEnd = myPlainText.indexOf('\n\n');
            String comments = myPlainText.substring(firstSpace, commentEnd);
            

            Schema.DescribeSObjectResult ar = Lease_Approval_Role__c.sObjectType.getDescribe();
            String approvalPrefix = ar.getKeyPrefix();
            System.debug(approvalPrefix);
            integer idStartPos = myHTMLText.indexOf(approvalPrefix);
            String approvalIdStr = myHTMLText.subString(idStartPos, idStartPos+15);
            system.debug(approvalIdStr);
            Id approvalId = id.valueOf(approvalIdStr);

            //we need to find the id that should be in a hidden div in the origional email text
            Lease_Approval_Role__c existing = [Select Id, Comments__c, User__c from Lease_Approval_Role__c where ID = : approvalId];
            if(!(comments.trim()==''||comments.trim()==null)){
                existing.Comments__c = comments.trim();
            }
            String newStatus;
            if(!(decisionStr.equalsIgnoreCase('approved')||decisionStr.equalsIgnoreCase('rejected')||decisionStr.equalsIgnoreCase('reject')||decisionStr.equalsIgnoreCase('approve')||decisionStr.equalsIgnoreCase('nfw'))){
                //invalid response
                sendInvalidEmailNotification(email, oppId);
                system.debug('Bad Response' + decisionStr);
            }
            else if(decisionStr.equalsIgnoreCase('approved')||decisionStr.equalsIgnoreCase('approve')){
                newStatus = 'Approved';
            }
            else if(decisionStr.equalsIgnoreCase('rejected')||decisionStr.equalsIgnoreCase('reject')||decisionStr.equalsIgnoreCase('nfw')){
                newStatus = 'Rejected';
            }
            existing.Status__c = newStatus;
            if(newStatus=='Approved'){
                //try and get the user to set
                try{
                    system.debug('From: ' + email.fromAddress);
                    User approvedBy = [Select Id from User where Email = :email.fromAddress and isActive = true limit 1];
                    existing.Approved_By__c = approvedBy.Id;
                }
                catch(QueryException e){
                    //what are we to do?
                    existing.Approved_By__c = existing.User__c;
                    system.debug(e.getMessage() + ' ' + e.getStackTraceString());
                }
                existing.Submitted_Date__c = system.today();
            }
            else if(newStatus=='Rejected'){
                //try and get the user to set
                try{
                    system.debug('From: ' + email.fromAddress);
                    User approvedBy = [Select Id from User where Email = :email.fromAddress and isActive = true limit 1];
                    existing.Rejected_By__c = approvedBy.Id;
                }
                catch(QueryException e){
                    //what are we to do?
                    existing.Rejected_By__c = existing.User__c;
                    system.debug(e.getMessage() + ' ' + e.getStackTraceString());
                }
                existing.Submitted_Date__c = system.today();
            }
            update existing;
            result.success = true;
            return result;
        }
        catch(Exception e){
            sendInvalidEmailNotification(email, oppId);
            system.debug('Exception: ' + e.getMessage() + e.getStackTraceString());
            result.success = false;
            return result;
        }
    }

    public static void sendInvalidEmailNotification(Messaging.inboundEmail badEmail, Id opportunityId){
        Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();

        Opportunity relatedOpp = [Select Id, Name from Opportunity where Id = : opportunityId];
        //email.setToAddresses(new List<String>{'jimmy@redpointsolutions.com'});
        email.setToAddresses(new List<String>{badEmail.fromAddress});
        email.setReplyTo('noreply@prologis.com');
        email.setSubject('ERROR - Invalid Reply for ' + relatedOpp.Name);
        String body = 'Your email reply for <a href="'+relatedOpp.Id+'">'+relatedOpp.Name+'</a> did not send due to invalid inputs.  <b>Do not reply to this email.</b>  Please reply again to the Approval Request email using the correct format.  Please type the word Approve or Reject as the first word in the first line of your reply.  To include comments, hit “return” after your response, and type any comments starting on the second line of your reply.';
        email.setHTMLBody(body);
        system.debug('Email? '+email);
        Messaging.sendEmail(new List<Messaging.SingleEmailMessage>{email});
    }
}

 
Hi, I need help. I seem to have decently followed the steps of creating a lighting component. I have a page that has links and these links have to be shown specific to user profile.  I am trying all these through a helloWorld component... I am using Chrome.

I have created an apex class, that has just one method : Here it goes.

(1) Apex Class
------------------
public with sharing class helloWorldApex {

       @AuraEnabled
 public String getCurrentUserProfile()
    {
        System.debug('Invoking helloWorldApex class-------------------');
        System.debug('User Id is --------'+UserInfo.getUserId());
        System.debug('User Name is --------'+UserInfo.getFirstName()) ;
        User currentUser = [SELECT Profile.Name FROM User WHERE Id = :UserInfo.getUserId() ];
        String userProfile=currentUser.Profile.Name;
        
        if( currentUser.Profile.Name == 'System Administrator' ){
            System.debug('User does have the System Administrator Access----------');
            
        }
     return userProfile;   
    }
}
Executing ths class is fine in the Debug Console and the User Id and name do get printed in the logs.

Now, I am trying to access this method getCurrentUserProfile() from the component.
Here is my component code. It is named as 

(2) helloWorld.cmp
-----------------------
<aura:component implements="force:appHostable" controller="helloWorldApex">
    <h1>Quick Create Links</h1>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

     <ui:outputText value="Your Profile is: "/>
     <ui:outputText value="{!v.currentUserProfile}"/>

< !-- Further here I see if the user profile has got specific profile and should show the links accordingly--> 
</aura:component>

(3) Here is the controller - helloWorldController.js

({
  doInit : function(component, event, helper) {
        debugger; //This does NOT get fired. Not sure why
        alert('doInit function invoked');  //this is getting fired in the browser.. 
    
       var action = component.get("c.getCurrentUserProfile"); //When control comes here, it throws an error in the browser ("Something has gone wrong. Cannot read property '$getActionDef$' of undefined. Please try again")

       alert('2');//this is not getting invoked
       action.setCallback(this, function(response) {
        var state=response.getState();
      alert();
      component.set("v.currentUserProfile", a.getReturnValue());
      });
    $A.enqueueAction(action);
   },
  
})

Can anyone tell me what I am missing ?

Thanks
Sajiv
 

 
Can I create a lightning page with simple html contents. The side bar is no longer available in the lightning mode.  The client is fine with showing links on the page instead of buttons.  

I need to show these links based on some conditions.  People with some profiles should not have access to some sections.  

Thanks
I am new to Salesforce. One of the requirement by my client is to make all the items available on classic mode to be available on lightning mode as well.

Now, we have a sidebar that has links to the system.  This sidebar is not visible in the  lightning mode.  Will it be available for the Spring 16 release and if yes, any clues on how I can get it ?