• Prathyu b
  • NEWBIE
  • 190 Points
  • Member since 2017

  • Chatter
    Feed
  • 6
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 30
    Replies
I have the following configuration set  and still Email and Task buttons not showing in the chatter lightning Lead Object:

1- Deliverability = All Emails

2- Task Has a record type

3- Feed Tracking is turned On for Lead Object

4- I have add Email and Task button on the Lead page layout in both sections 'Salesforce Mobile and Lightning Experience Actions' and 'Quick Actions in the Salesforce Classic Publisher' ,
 and made sure that im viewing the right page layouts

5- I add Email and Task button to the Global Publisher Layout in both sections 'Salesforce Mobile and Lightning Experience Actions' and 'Quick Actions in the Salesforce Classic Publisher'

6- I do have Chatter Settings -> Enable Actions in the Publisher -> set to true

here screen shots    

User-added image

User-added imageUser-added imageUser-added image
User-added image


but nothing is working

 
 
Hi,

I have a special discount , However thing is if that discount field gets applied all other fields should get disabled.

I am thinking to apply a checkbox "special discount". Once that gets filled in. all other fields gets disabled and only special discount text field gets enabled.

All fields are lightning input

How can i do it in lightning ?
i've had this a couple of time in the last few week where a lighting component will not out put a date field to the page in an iteration.

apex class
@AuraEnabled
public static List<Start_Network_Activity__c> getSNAEvents(){
        return [SELECT ID,End_Date__c,Date__c,Name FROM Network_Activity__c];
}

component (not entire componet but the issue parts are there)
<aura:component implements="flexipage:availableForAllPageTypes" access="global" controller="ActivityCtrl" >

<!-- fire onload controller to populate page with content -->
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

<!-- setup a list of records that are default loaded onto the page ready for filtering in progress records -->
    <aura:attribute access="global" name="activities" type="Network_Activity__c[]" />

<table aura:id="activitytable" class="slds-table slds-table_bordered slds-max-medium-table_stacked-horizontal slds-show">
                                <thead>
                                    <tr class="slds-text-title_caps">
                                        <th scope="col">
                                            <div class="slds-truncate" title="Title of Activity">Title of Activity</div>
                                        </th>
                                        <th scope="col">
                                            <div class="slds-truncate" title="Status">Start Date</div>
                                        </th>
                                        <th scope="col">
                                            <div class="slds-truncate" title="Status">End Date</div>
                                        </th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <aura:iteration items="{!v.activities}" var="act">
                                        <tr class="slds-hint-parent">
                                            <td data-label="Title of Activity">
                                                <div class="slds-truncate" title="{!act.Name}"><a href="{!'/one/one.app?#/sObject/'+ act.Id + '/view'}" target="_blank">{!act.Name}</a></div>
                                            </td>
                                            <td data-label="Type">
                                                <div class="slds-truncate" title="{!act.RecordTypeName__c}">{!act.RecordTypeName__c}</div>
                                            </td>
                                            <td data-label="Start Date">
                                                <div class="slds-truncate" title="{!act.Date__c}"><ui:outputDate value="{!act.Date__c}"/></div>
                                            </td>
                                            <td data-label="End Date">
                                                <div class="slds-truncate" title="{!act.End_Date__c}"><ui:outputDate value="{!act.End_Date__c}"/></div>
                                            </td>
                                        </tr>
                                    </aura:iteration>
                                    
                                </tbody>
                            </table>
</aura:component>

controller
 
({
    // preloads the content on the page
	doInit : function(component, event, helper) {
helper.getActivities(component);
	}
)}

js helper
 
{(
getActivities: function(component, event) {
        
        // prepare a var to pull in a list of activities from the db
        var action = component.get("c.getSNAEvents");
        // perform the actual call to db
        action.setCallback(this, function(response) {
            // get the query state so we can handle error
            var state = response.getState();
            // confirm if the call was successful
            if (state === "SUCCESS") {
                // get the response in a var
                var storeResponse = response.getReturnValue();
                // check the length of the response if it is zero we need to display an error message
                if (storeResponse.length == 0) {
                   console.log('no records');
                } else {
                    component.set("v.activities", storeResponse);
                }
            } else {
               console.log('error');
            }
        });                           
        $A.enqueueAction(action);
    }
)}

permissions are fine, as debug shows the field is pulling back the only way i can get it to display is by making it into a formula field and then displaying the formula which works fine.

what am i missing? ​
Hi, I want to write a test class for this....I am not able to get what i should write for the fetching cookies method and for the go method i am not able to cover all the lines.

public with sharing class ctr_validation {
     // Varaible Declaration
    Public String lang {get;set;}
    Public Contact con { get; set;}
    Public String tout { get; set;}
    Public String tablen{get;set;}
    //Public String existingorderid { get; set;}
    List<String> errorMessages = new List<String>();
    
    /* Constructor Starts here */      
    public ctr_validation(){
        lang = ApexPages.currentPage().getParameters().get('lang');
        tout = System.currentPageReference().getParameters().get('tout');
        tablen = ApexPages.currentPage().getParameters().get('tablen');
        languageCookiValue(lang);
        con = new Contact();
       }
    //Fetch cookie's language
    private string fetchLanguageCook(){
        string data='';
        Cookie cook = ApexPages.currentPage().getCookies().get('language');
        if(cook != null){
            data = cook.getvalue();
        }
        return data;
    }
    
     /* Go method Starts here */  
    public PageReference go() {
        try{
             if(con.MobilleNumber__c.length() < 10 || con.MobilleNumber__c.startsWith('00') || con.MobilleNumber__c.length() > 10)
              {
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, 'Please enter 10 Digit for Mobile Number EX: XXXXXXXXXX'));  
              }
              
              else if (con.MobilleNumber__c!= null && con.MobilleNumber__c!= '')
              {
                  List<Contact> checkcon = new List<Contact>();
                  checkcon  = [select id, name, phone, MobilleNumber__c from contact where MobilleNumber__c=:con.MobilleNumber__c limit 1];
                  system.debug('&&&&'+con);
                  if(checkcon.size()>0){
                      Contact conupdate = new Contact();
                      conupdate.Last_Login_Reff_Id__c = string.valueof(system.now());
                      conupdate.id =checkcon[0].id;
                      update conupdate;
                      PageReference conpg = new PageReference('/apex/vfp_main?cid='+checkcon[0].id+'&lang='+lang+'&tout='+tout+'&tablen='+tablen);
                      conpg.setRedirect(TRUE);
                      return conpg;
                  }
                  else{
                      
                      PageReference connewpg = new PageReference('/apex/vfp_contactInfo?lang='+lang+'&mob='+con.MobilleNumber__c+'&tout='+tout+'&tablen='+tablen);
                      connewpg.setRedirect(TRUE);
                      return connewpg;
                  }
             }
             else
             {
              ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Please enter the mobile number'));
              return null;
             }
           
           }
           Catch(Exception e){
              ApexPages.addmessages(e);
              return null;
           }
            return null;
   }
   /* Go method ends here */      
    
    /* home method Starts here */      
    public PageReference home() {
        PageReference homepg= new PageReference('/apex/vfp_home');
        homepg.setRedirect(TRUE);
        return homepg;
    }
   /* home method ends here */   
           
             
}
  • June 21, 2017
  • Like
  • 0
Hi have created test class for below class
Class
public class DispatcherNewCaseController {

   public DispatcherNewCaseController(ApexPages.StandardController controller) {
        this.controller = controller;
        system.debug('in controller');
        //getRedir();
    }
    
    public PageReference getRedir() {

        User u = [Select firstname, IsPortalEnabled__c From user Where Id = :UserInfo.getUserId()];
        system.debug('user first name=='+u.IsPortalEnabled__c);// added by santosh
        PageReference redir;

        if (u.IsPortalEnabled__c == false) {
           
            redir  = new PageReference('/500/e?retURL=/500/o');
            redir.getParameters().put('nooverride','1');
               }


         else {
             redir = new PageReference('/apex/casecreation');
           
        }

       redir.setRedirect(true);
       return redir ;
    }

   
     private final ApexPages.StandardController controller;
}

Testclass:
@istest
public class DispatcherNewCaseController{
static testMethod void DispatcherNewCaseController(){
      
     Account testAccount = new Account(name='Test Company Name',Billing_Account_Number__c='CONTROLLER');
     insert testAccount;
    
    Account testAccount2 = new Account(name='Test Company Name',Billing_Account_Number__c='CONTROLLER');   
    
     DispatcherNewCaseController dc = new DispatcherNewCaseController();
     dc.acctNum='CONTROLLER';
    
     Case ca = new Case(Subject='Test Controller Acct Case');
     ca.Product ='FinancialForce Accounting';
     ca.Product Area = 'Admin Screens';
     ca.Priority = '3-Major Problem';
    
     dc.c = ca;    
     dc.submitcase();    

insert testAccount2;
 dc.submitcase();    
}
}

Iam facing issue on test class please help me to create test class on above apex class ;;



 
Lead can convert, Only to accounts. In Lead convert page lageout (only account) must be visible.
I have the following configuration set  and still Email and Task buttons not showing in the chatter lightning Lead Object:

1- Deliverability = All Emails

2- Task Has a record type

3- Feed Tracking is turned On for Lead Object

4- I have add Email and Task button on the Lead page layout in both sections 'Salesforce Mobile and Lightning Experience Actions' and 'Quick Actions in the Salesforce Classic Publisher' ,
 and made sure that im viewing the right page layouts

5- I add Email and Task button to the Global Publisher Layout in both sections 'Salesforce Mobile and Lightning Experience Actions' and 'Quick Actions in the Salesforce Classic Publisher'

6- I do have Chatter Settings -> Enable Actions in the Publisher -> set to true

here screen shots    

User-added image

User-added imageUser-added imageUser-added image
User-added image


but nothing is working

 
 
Hi,

I have a special discount , However thing is if that discount field gets applied all other fields should get disabled.

I am thinking to apply a checkbox "special discount". Once that gets filled in. all other fields gets disabled and only special discount text field gets enabled.

All fields are lightning input

How can i do it in lightning ?
    @AuraEnabled
    public static String getCanonicalLink(String articleId) {
        String urlName = null ; 
        try{
            if(String.isNotBlank(articleId)) {
                List<Knowledge__kav> lstCurrentArticle = [SELECT id , Custom_Canonical_URL__c ,UrlName , Page_Index__c,
                                                          Custom_Canonical_URL__r.UrlName
                                                          FROM Knowledge__kav WHERE Id =: articleId
                                                          LIMIT 1];
                String domainURL = Site.getBaseCustomUrl()+Site.getPathPrefix()+ARTICLE_PATH; 
                System.debug('Value of page index '+lstCurrentArticle[0].Page_Index__c);
                //if record found and record says its page is index (TRUE denotes NO INDEX here)
                if(!lstCurrentArticle.isEmpty() && ! lstCurrentArticle[0].Page_Index__c) {
                    
                    if(String.isNotBlank(lstCurrentArticle[0].Custom_Canonical_URL__c)) {
                        List<Knowledge__kav> lstParentArticle = [SELECT id , UrlName
                                                                 FROM Knowledge__kav WHERE Id =: lstCurrentArticle[0].Custom_Canonical_URL__c
                                                                 LIMIT 1];
                        if(!lstParentArticle.isEmpty()){
                            System.debug('Parent Url Name == '+lstCurrentArticle[0].Custom_Canonical_URL__r.UrlName);
                            urlName = domainURL+lstParentArticle[0].UrlName ;     
                        }
                        
                    }
                    else {
                        urlName = domainURL+lstCurrentArticle[0].UrlName ; 
                    }
                }
            }
        }
        catch(Exception objExp) {
            ApplicationLogger.addLog('requestName', objExp); 
        }
        
        return urlName ; 
    }
I am receiving this error when I am using the Magic Mover for the Lightning Conversion.

Tooling API Error:Unauthorized (401) - [{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}] 

Does anyone know how to resolve this?
i've had this a couple of time in the last few week where a lighting component will not out put a date field to the page in an iteration.

apex class
@AuraEnabled
public static List<Start_Network_Activity__c> getSNAEvents(){
        return [SELECT ID,End_Date__c,Date__c,Name FROM Network_Activity__c];
}

component (not entire componet but the issue parts are there)
<aura:component implements="flexipage:availableForAllPageTypes" access="global" controller="ActivityCtrl" >

<!-- fire onload controller to populate page with content -->
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

<!-- setup a list of records that are default loaded onto the page ready for filtering in progress records -->
    <aura:attribute access="global" name="activities" type="Network_Activity__c[]" />

<table aura:id="activitytable" class="slds-table slds-table_bordered slds-max-medium-table_stacked-horizontal slds-show">
                                <thead>
                                    <tr class="slds-text-title_caps">
                                        <th scope="col">
                                            <div class="slds-truncate" title="Title of Activity">Title of Activity</div>
                                        </th>
                                        <th scope="col">
                                            <div class="slds-truncate" title="Status">Start Date</div>
                                        </th>
                                        <th scope="col">
                                            <div class="slds-truncate" title="Status">End Date</div>
                                        </th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <aura:iteration items="{!v.activities}" var="act">
                                        <tr class="slds-hint-parent">
                                            <td data-label="Title of Activity">
                                                <div class="slds-truncate" title="{!act.Name}"><a href="{!'/one/one.app?#/sObject/'+ act.Id + '/view'}" target="_blank">{!act.Name}</a></div>
                                            </td>
                                            <td data-label="Type">
                                                <div class="slds-truncate" title="{!act.RecordTypeName__c}">{!act.RecordTypeName__c}</div>
                                            </td>
                                            <td data-label="Start Date">
                                                <div class="slds-truncate" title="{!act.Date__c}"><ui:outputDate value="{!act.Date__c}"/></div>
                                            </td>
                                            <td data-label="End Date">
                                                <div class="slds-truncate" title="{!act.End_Date__c}"><ui:outputDate value="{!act.End_Date__c}"/></div>
                                            </td>
                                        </tr>
                                    </aura:iteration>
                                    
                                </tbody>
                            </table>
</aura:component>

controller
 
({
    // preloads the content on the page
	doInit : function(component, event, helper) {
helper.getActivities(component);
	}
)}

js helper
 
{(
getActivities: function(component, event) {
        
        // prepare a var to pull in a list of activities from the db
        var action = component.get("c.getSNAEvents");
        // perform the actual call to db
        action.setCallback(this, function(response) {
            // get the query state so we can handle error
            var state = response.getState();
            // confirm if the call was successful
            if (state === "SUCCESS") {
                // get the response in a var
                var storeResponse = response.getReturnValue();
                // check the length of the response if it is zero we need to display an error message
                if (storeResponse.length == 0) {
                   console.log('no records');
                } else {
                    component.set("v.activities", storeResponse);
                }
            } else {
               console.log('error');
            }
        });                           
        $A.enqueueAction(action);
    }
)}

permissions are fine, as debug shows the field is pulling back the only way i can get it to display is by making it into a formula field and then displaying the formula which works fine.

what am i missing? ​
Hi,
I have a requirement,
While changing the owner of the record, only the user in the below hierarchy must be visible in the lookup dialod box, as shown in the figureUser-added image
Hi

The below code fails to load the App. Can any one suggest me how to view the error using lightning inspector
<aura:component >
    <lightning:input />
</aura:component>

NOTE: <lightning:input name="test" label="hello"/>  --> Updating the code with this line works. But I want to see how to debug the above error
I am using Lightning inspector chrome extension. But cannot see the error.

User-added image

 
 
Hi all,

We are retrieving details from SF using SOQL and we encountered an issue where the title of the contact is not the same with the SF CRM UI. We are wondering what might be the problem. Thanks in advance

Cheers.
Hi,

Here iam adding sum of revenue__c to account column acc.Finance__c.
for Example :-- 
 if  opportunity.member__c.Revenue__c is 10 
 & opportunity.member__c.Revenue__c is 20
 total = 30 
 this value iam printing on acc.Finance__c column,but now the problem is its keep on adding the values when we are changing the value on same record.
 for example :--
 for the same above record the value is 30.
 if i change the same opportunity.member__c.Revenue__c from 10 to 20
 & opportunity.member__c.Revenue__c is 20
 the value should be 40 but here it counting has 50.
 its counting the old value even.
 can any one help me to resolve it??
 
trigger updateAccount on member__c (After Insert,After update,After Delete,) {
    
    List<Account> UpdateList = new List<Account>();

    Id recTypeFinance = [select Id,name from RecordType where name='Finance' and SObjectType='member__c' limit 1].Id;
    
    string ids;
    if(Trigger.isInsert || Trigger.isUpdate)
    {
        for(Asset__c asst : Trigger.new) {
            if(asst.Opportunity__c != null)
                ids= asst.id;
        }
        
        For(member__c ast:[select Id,Opportunity__c,Revenue__c,RecordTypeId from member__c where ID=:ids]){     
            
            if(ast.RecordTypeId == recTypeFinance){
         for(opportunity opp : [Select Id,AccountId from Opportunity where Id =: ast.Opportunity__c]){
                    for(Account acc : [Select Id,Finance__c from Account where Id =: opp.AccountId]){
                        if(acc.Finance__c == null){
                            acc.Finance__c= ast.Revenue__c;
                        }else{
                            acc.Finance__c += ast.Revenue__c;
                        }
                        UpdateList.add(acc);
                    }
                }
            }
        }
        update UpdateList;
     }

 
Hi, I want to write a test class for this....I am not able to get what i should write for the fetching cookies method and for the go method i am not able to cover all the lines.

public with sharing class ctr_validation {
     // Varaible Declaration
    Public String lang {get;set;}
    Public Contact con { get; set;}
    Public String tout { get; set;}
    Public String tablen{get;set;}
    //Public String existingorderid { get; set;}
    List<String> errorMessages = new List<String>();
    
    /* Constructor Starts here */      
    public ctr_validation(){
        lang = ApexPages.currentPage().getParameters().get('lang');
        tout = System.currentPageReference().getParameters().get('tout');
        tablen = ApexPages.currentPage().getParameters().get('tablen');
        languageCookiValue(lang);
        con = new Contact();
       }
    //Fetch cookie's language
    private string fetchLanguageCook(){
        string data='';
        Cookie cook = ApexPages.currentPage().getCookies().get('language');
        if(cook != null){
            data = cook.getvalue();
        }
        return data;
    }
    
     /* Go method Starts here */  
    public PageReference go() {
        try{
             if(con.MobilleNumber__c.length() < 10 || con.MobilleNumber__c.startsWith('00') || con.MobilleNumber__c.length() > 10)
              {
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, 'Please enter 10 Digit for Mobile Number EX: XXXXXXXXXX'));  
              }
              
              else if (con.MobilleNumber__c!= null && con.MobilleNumber__c!= '')
              {
                  List<Contact> checkcon = new List<Contact>();
                  checkcon  = [select id, name, phone, MobilleNumber__c from contact where MobilleNumber__c=:con.MobilleNumber__c limit 1];
                  system.debug('&&&&'+con);
                  if(checkcon.size()>0){
                      Contact conupdate = new Contact();
                      conupdate.Last_Login_Reff_Id__c = string.valueof(system.now());
                      conupdate.id =checkcon[0].id;
                      update conupdate;
                      PageReference conpg = new PageReference('/apex/vfp_main?cid='+checkcon[0].id+'&lang='+lang+'&tout='+tout+'&tablen='+tablen);
                      conpg.setRedirect(TRUE);
                      return conpg;
                  }
                  else{
                      
                      PageReference connewpg = new PageReference('/apex/vfp_contactInfo?lang='+lang+'&mob='+con.MobilleNumber__c+'&tout='+tout+'&tablen='+tablen);
                      connewpg.setRedirect(TRUE);
                      return connewpg;
                  }
             }
             else
             {
              ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Please enter the mobile number'));
              return null;
             }
           
           }
           Catch(Exception e){
              ApexPages.addmessages(e);
              return null;
           }
            return null;
   }
   /* Go method ends here */      
    
    /* home method Starts here */      
    public PageReference home() {
        PageReference homepg= new PageReference('/apex/vfp_home');
        homepg.setRedirect(TRUE);
        return homepg;
    }
   /* home method ends here */   
           
             
}
  • June 21, 2017
  • Like
  • 0