• srikanth gubbala 1
  • NEWBIE
  • 50 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 4
    Replies
Hi guys i am new to anlystics please help me . Suppose if we are creating a case record in org will it automatically show(real-time) on analytics dashboard without running recipe or connection ?
Example:-

   Set<id> AccIdList = new Set<id>();
    List<Account> accountsToUpdate = new List<Account>();
    List<String> conNames = new List<String>();
    for(Contact con : contacts){
        if(con.PartnerDesignation__c== 'Principal'||(con.PartnerDesignation__c!=oldMap.get(con.Id).PartnerDesignation__c && con.PartnerDesignation__c!='Principal')){
        AccIdList.add(con.accountid);
        }
    }   

This works fine if multipicklist is having only one value but ifts having picklist "Princpal" and "Secondary" its not working 
trigger ContactNamesOnAccount on Contact (after update, after insert) {    
  Set<id> accIdList = new Set<id>();
  for(Contact con : Trigger.new){
    accIdList.add(con.accountid);
  }

  List<Account> accUpdateList = new List<Account>();
  List<String> names = new List<String>;

  for(Account acc : [Select id, Contact_Names__c, (Select LastName From Contacts) From Account Where Id In : accIdList]){
    for(Contact con : acc.contacts){

      if(con.LastName != null){
        /* add name to list */
        names.add(con.LastName);
      }
    }

    /* update name separating ', '  */
    acc.Contact_Names__c = String.join(names, ', ');;
    accUpdateList.add(acc);

    /* clear list to add new account contact names */
    names.clear();
  }    
  update accUpdateList;
}
Controller.js
init: function(component, event, helper) {
        var action = component.get('c.fetchUser'); 
        action.setCallback(this, function(response) {
            //store state of response
            var state = response.getState();
            if (state === "SUCCESS") {
               var retData = response.getReturnValue();
                component.set('v.email', retData);
                console.log('success'+v.email); 
               }
        });
        
        $A.enqueueAction(action);
        },
        
    handleChange : function(component, event) {
           var changeValue = event.getParam("value");
        if(changeValue === 'option1'){
           var urlEvent = $A.get("e.force:navigateToURL");
            urlEvent.setParams({
                "url": "......."
            });
            urlEvent.fire();
        }else{
       
             var UserName =  $A.get("$SObjectType.CurrentUser.Email"); 
            var address=v.email;
            console.log('Accoutn Nam'+address); 
               //var address=UserName;
            window.location.href = 'mailto:dell@mail.com?cc='+UserName+'&Subject='+address+'name';
                 
        }
    },
    
    showModel: function(component, event, helper) {
      component.set("v.showModal", true);
   },
  
   hideModel: function(component, event, helper) {
      component.set("v.showModal", false);
   },
        
})



i want to pass v.email to window.location.href which is in different function.


apexcalss 

public class currentUserInfoCtrl {
   @AuraEnabled 
    public static string fetchUser(){
      // User u = [select id,Name,email from User where id =: UserInfo.getUserId()]; 
      //  return u;
        String Accname = [SELECT Contact.Account.Name FROM USER WHERE Id =: UserInfo.getUserId() LIMIT 1].Contact.Account.Name;
        return Accname;
    }
     }
Hi there,
I was wondering if there is a Favourite feature available in lightning for community users ?I was able to use it for other profiles  but for community users i cant see the Favorite icon.I want to know if i can enable it to community users so that they can bookmark the KB articles or cases.


Favorite
Thanks in advance.
Example:-

   Set<id> AccIdList = new Set<id>();
    List<Account> accountsToUpdate = new List<Account>();
    List<String> conNames = new List<String>();
    for(Contact con : contacts){
        if(con.PartnerDesignation__c== 'Principal'||(con.PartnerDesignation__c!=oldMap.get(con.Id).PartnerDesignation__c && con.PartnerDesignation__c!='Principal')){
        AccIdList.add(con.accountid);
        }
    }   

This works fine if multipicklist is having only one value but ifts having picklist "Princpal" and "Secondary" its not working 
trigger ContactNamesOnAccount on Contact (after update, after insert) {    
  Set<id> accIdList = new Set<id>();
  for(Contact con : Trigger.new){
    accIdList.add(con.accountid);
  }

  List<Account> accUpdateList = new List<Account>();
  List<String> names = new List<String>;

  for(Account acc : [Select id, Contact_Names__c, (Select LastName From Contacts) From Account Where Id In : accIdList]){
    for(Contact con : acc.contacts){

      if(con.LastName != null){
        /* add name to list */
        names.add(con.LastName);
      }
    }

    /* update name separating ', '  */
    acc.Contact_Names__c = String.join(names, ', ');;
    accUpdateList.add(acc);

    /* clear list to add new account contact names */
    names.clear();
  }    
  update accUpdateList;
}

I have trigger where i need to check a Multi select picklist value if it contains Value Temporary then the value has to update by entering into If() Condition as shown below.

 

trigger Update_Candidate_TempLocation on Contact (before insert,before update)
{
for(Contact c:trigger.new)
{
if(c.Candidate_Position_Type_IDs_New__c=='temporary' && c.RecordTypeid=='012D0000000hW06')
{
c.Candidate_Temp_Location_New__c=c.MailingState ;
}

}

}

 

This is my code. How to look into it, if multi select picklist contains Temporary!!!

 

 


  • March 02, 2012
  • Like
  • 0