• Colton Wehking
  • NEWBIE
  • 200 Points
  • Member since 2019

  • Chatter
    Feed
  • 7
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 19
    Replies

When I run the below code I get the error I listetd in the title:

Unexpected token '<'.

I believe it is my syntax but I can't see a debug log that directs me to a line in my code that is listing the issue. 

Below is the code I am trying to run. 

List<CCMI__Milestone_Project__c> CCMIProject = 
    [SELECT 
    CCMI__Opportunity__c,
    Id 
    FROM CCMI__Milestone_Project__c WHERE id = a6X3D000000OVfGUAW
     ];

List<CCMI__Milestone_Task__c> CCMITask = 
    [SELECT 
    CCMI__Milestone_Project__c,
    Id,
    Name 
    FROM CCMI__Milestone_Task__c WHERE Project__c = a6X3D000000OVfGUAW 
     ];

List<CCMI__Milestone_Task__c> TempTask = 
    [SELECT 
    CCMI__Milestone_Project__c,
    Id,
    Name 
    FROM CCMI__Milestone_Task__c WHERE Project__c = a6X3D000000OVerUAG
     ];

List<Department_To_Task__c> DeptTask = 
    [SELECT 
    Id,
    Milestone_Task__c,
    Name 
    FROM Department_To_Task__c
     ];

List<Opportunity> Oppo = 
    [SELECT 
    Id 
    FROM Opportunity WHERE id = 0063D00000AudqdQAB
     ];

List<OpportunityTeamMember> OppoTeam = 
    [SELECT 
    Id,
    Name,
    OpportunityId,
    TeamMemberRole 
    FROM OpportunityTeamMember WHERE OpportunityId = 0063D00000AudqdQAB  
     ];

List<CCMI__Milestone_Assignment2__c> Assign =
    [SELECT CCMI__Assignee_Name__c,CCMI__Milestone_Task__c 
    FROM CCMI__Milestone_Assignment2__c     
    ];

     
    for(CCMI__Milestone_Task__c TT:TempTask){

        for (CCMI__Milestone_Task__c CT:CCMITask){

            for(Department_To_Task__c DT:DeptTask){

                for(OpportunityTeamMember OT:OppoTeam){

                    if(TT.Name == CT.Name && OT.TeamMemberRole == DT.Name )     
                    {
                        Assignment sign = new sign (
                        Assign.CCMI__Assignee_Name__c = OT.Name;
                        Assign.CCMI__Milestone_Task__c = CT.Id;
                        System.debug('** True **'); 
                       )
                        insert sign;
                    }
             }
          }
        }
      }



update Assign;

public static void DeadIntel(list<Contact> cont){
        Set<Id> accIds = new Set<Id>();
        for(Contact conList : cont){
            if(conList.accountId!=null){
                accIds.add(conList.accountId);    
            }
            
        }
        
        Map<Id, List<Contact>> accContactMap = new Map<Id, List<Contact>>();
        List<Account> accUpdateList = new List<Account>();
        for(Contact obj : [SELECT accountId,Dead__c
                           FROM Contact
                           WHERE accountId IN :accIds]){
                               
                               List<Contact> contLists;
                               if(accContactMap.containsKey(obj.accountId)){
                                   contLists = accContactMap.get(obj.accountId);
                               }else{
                                   contLists = new List<Contact>();
                               }
                               contLists.add(obj);
                               accContactMap.put(obj.accountId, contLists);
                           }
        for(Id accId : accContactMap.keySet()){
            Integer count_of_Dead = 0;
            Integer total_con = accContactMap.get(accId).size();
            if(accContactMap.get(accId).size() > 1){              
                for(integer i =0 ; i<accContactMap.get(accId).size(); i++)
                    if(accContactMap.get(accId)[i].Dead__c == true){
                        count_of_Dead++;
                    }
            }
            if((count_of_Dead/total_con)*100 > 70)
                accUpdateList.add(new Account(id = accId, needintel__c = true));   
        }   
        if(!accUpdateList.isEmpty()){
            update accUpdateList;
        }
    }
//Trigger
trigger UpdateContact on Contact (after update) {
if(Trigger.isUpdate && Trigger.isAfter){
        AccountContact.DeadIntel(Trigger.new);
    }
}

 
Can somone who has taken this certification recently confirm whether Lightning Web Component questions are also being asked. Secondly is it still a lot of Visualforce or Aura lightning questions in the test currently.
if( ('Closed Won' == o.StageName) && ('Closed Won' != opportunityOldMap.get(o.Id).StageName) && (!o.Line_of_Service__c.contains('Agawam')))
Can someone help me break this IF statement into a nested IF statement so I can add system.debug between the conditions?  Thanks
 
I need to send an email to one of two Public Groups depending on the value of the 3 fields in the `If Statement`. Within the the If and Else blocks I have a `String mailGroup` with the value of the Public Class.Now that I need the Else statement to access that private class with a different Public class name, I am having issues inserting `String mailGroup` , into the Private class `getAddresses()`. The Variable `emailAdds` declared at the top holds the email address values from the `getAddresses()` function. Is it my syntax? I am receiving numerous errors:

`Unexpected token 'private'`
 `Unexpected token '<'`
`Unexpected token '>'`

`Method does not exist or incorrect signature: void getAddresses(String) from type CaseHandlerCountAlert`

 
trigger CaseHandlerCountAlert on Case (after insert) {
    
 				String messageToSend;
   				List<String> ListOfMessages = new List<String>();
   		     	Set<Id> AcctIds = new Set<Id>();
				List<String> clientEmail;
				String messageBody;
    			String mailGroup;
    			List<String> emailAdds = getAddresses(mailGroup);
    
List<AggregateResult> AggregateResultList = [SELECT AccountId, Account.Name name, COUNT(Id) co
                                             FROM Case
                                             WHERE CreatedDate = LAST_N_DAYS:1 AND 
                                             Id IN :Trigger.New
                                             GROUP BY AccountId, Account.Name
                                             HAVING COUNT(Id)  >= 5 ];
    		 
            Map<Id, String> accountIdEmailmessageMap = new Map<Id, String>();
            
				for(AggregateResult aggr: AggregateResultList){
                String messageToSend = 'Account name: ' + aggr.get('name') +
                    ' has ' + (Integer)aggr.get('co') +
                    ' cases opened in the last 8 days.';
                Id accId = (Id)aggr.get('AccountId');
                accountIdEmailmessageMap.put(accId,messageToSend);
                AcctIds.add(accId); 
            }
            
			
List<Case> caseList = [SELECT Id, AccountId, Account.Name,Parent_Project_if_applicable__r.Implementation_status__c,
                       Parent_Project_if_applicable__r.PM_Implementation_Status__c, 
                       Parent_Project_if_applicable__r.RCM_Implementation_Status__c,
                       Parent_Project_if_applicable__r.Client_Advisor_Email__c
                       FROM Case
                       WHERE AccountId IN :AcctIds];

for(Case cl:caseList){ 
  
    if(cl.Parent_Project_if_applicable__r.Implementation_status__c == 'Live - Closed Project'||
       cl.Parent_Project_if_applicable__r.PM_Implementation_Status__c == 'Live - Closed Project'||
       cl.Parent_Project_If_Applicable__r.RCM_Implementation_Status__c == 'Live - Closed Project'){    
        	
           	
            mailGroup = 'Customer Success Managers'; 
           
	String messageBody = accountIdEmailmessageMap.get(cl.AccountId);
        
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
	  mail.setSenderDisplayName('IT Support'); 
          mail.setToAddresses(emailAdds);
          mail.Subject = 'Multiple cases created alert message';
          mail.setPlainTextBody(messageBody);
           
         if(messageToSend != null){
          Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
          }
        
    }
    else{  
            
      			
         mailGroup = 'BI Team';
         
        
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
	  mail.SetSenderDisplayName('IT Support');
          mail.setToAddresses(emailAdds);
          mail.Subject = 'Multiple cases created alert message';
          mail.setPlainTextBody(messageToSend);
      
        
        if(messageToSend != null){
          Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
        }
    }
       
         
    }

    


private List<String> getAddresses(mailGroup){
    List<User> UserList =
        [SELECT id, name, email
         FROM User 
         WHERE id 
         IN (SELECT userorgroupid 
             FROM groupmember
             WHERE group.name = :mailGroup)];
    
    List<String> emailString = new List<String>();
    
    for(User u: UserList){
        emailstring.add(u.email);
    }   
    return (emailString);
    //System.debug(emailString);
}    

               }

 
Hi everyone,

I created an Apex code in my sandbox (following this link (https://help.salesforce.com/articleView?id=hvs_cadences_auto_remove_targets_process_apex.htm&type=5) and this link (https://help.salesforce.com/articleView?id=changesets_outbound_components_select.htm&type=5)) but cannot get it to upload to my Production Org. Anyone know why it says I am not authorized to do so?

User-added image
Any help is much appreciated!!
Hi,

From a before insert trigger on opportunity, I want to get all the opportunities inserted, find their related contact record and populate a field on the contact record with its associated opportunity record.
It seems like a simple concept, and I know I have to use a Map to achieve this, but to minimize the number of SOQL queries, it becomes real tricky.

Any help would be appreciated!
Parsa

When I run the below code I get the error I listetd in the title:

Unexpected token '&lt;'.

I believe it is my syntax but I can't see a debug log that directs me to a line in my code that is listing the issue. 

Below is the code I am trying to run. 

List<CCMI__Milestone_Project__c> CCMIProject = 
    [SELECT 
    CCMI__Opportunity__c,
    Id 
    FROM CCMI__Milestone_Project__c WHERE id = a6X3D000000OVfGUAW
     ];

List<CCMI__Milestone_Task__c> CCMITask = 
    [SELECT 
    CCMI__Milestone_Project__c,
    Id,
    Name 
    FROM CCMI__Milestone_Task__c WHERE Project__c = a6X3D000000OVfGUAW 
     ];

List<CCMI__Milestone_Task__c> TempTask = 
    [SELECT 
    CCMI__Milestone_Project__c,
    Id,
    Name 
    FROM CCMI__Milestone_Task__c WHERE Project__c = a6X3D000000OVerUAG
     ];

List<Department_To_Task__c> DeptTask = 
    [SELECT 
    Id,
    Milestone_Task__c,
    Name 
    FROM Department_To_Task__c
     ];

List<Opportunity> Oppo = 
    [SELECT 
    Id 
    FROM Opportunity WHERE id = 0063D00000AudqdQAB
     ];

List<OpportunityTeamMember> OppoTeam = 
    [SELECT 
    Id,
    Name,
    OpportunityId,
    TeamMemberRole 
    FROM OpportunityTeamMember WHERE OpportunityId = 0063D00000AudqdQAB  
     ];

List<CCMI__Milestone_Assignment2__c> Assign =
    [SELECT CCMI__Assignee_Name__c,CCMI__Milestone_Task__c 
    FROM CCMI__Milestone_Assignment2__c     
    ];

     
    for(CCMI__Milestone_Task__c TT:TempTask){

        for (CCMI__Milestone_Task__c CT:CCMITask){

            for(Department_To_Task__c DT:DeptTask){

                for(OpportunityTeamMember OT:OppoTeam){

                    if(TT.Name == CT.Name && OT.TeamMemberRole == DT.Name )     
                    {
                        Assignment sign = new sign (
                        Assign.CCMI__Assignee_Name__c = OT.Name;
                        Assign.CCMI__Milestone_Task__c = CT.Id;
                        System.debug('** True **'); 
                       )
                        insert sign;
                    }
             }
          }
        }
      }



update Assign;

public static void DeadIntel(list<Contact> cont){
        Set<Id> accIds = new Set<Id>();
        for(Contact conList : cont){
            if(conList.accountId!=null){
                accIds.add(conList.accountId);    
            }
            
        }
        
        Map<Id, List<Contact>> accContactMap = new Map<Id, List<Contact>>();
        List<Account> accUpdateList = new List<Account>();
        for(Contact obj : [SELECT accountId,Dead__c
                           FROM Contact
                           WHERE accountId IN :accIds]){
                               
                               List<Contact> contLists;
                               if(accContactMap.containsKey(obj.accountId)){
                                   contLists = accContactMap.get(obj.accountId);
                               }else{
                                   contLists = new List<Contact>();
                               }
                               contLists.add(obj);
                               accContactMap.put(obj.accountId, contLists);
                           }
        for(Id accId : accContactMap.keySet()){
            Integer count_of_Dead = 0;
            Integer total_con = accContactMap.get(accId).size();
            if(accContactMap.get(accId).size() > 1){              
                for(integer i =0 ; i<accContactMap.get(accId).size(); i++)
                    if(accContactMap.get(accId)[i].Dead__c == true){
                        count_of_Dead++;
                    }
            }
            if((count_of_Dead/total_con)*100 > 70)
                accUpdateList.add(new Account(id = accId, needintel__c = true));   
        }   
        if(!accUpdateList.isEmpty()){
            update accUpdateList;
        }
    }
//Trigger
trigger UpdateContact on Contact (after update) {
if(Trigger.isUpdate && Trigger.isAfter){
        AccountContact.DeadIntel(Trigger.new);
    }
}

 
Can somone who has taken this certification recently confirm whether Lightning Web Component questions are also being asked. Secondly is it still a lot of Visualforce or Aura lightning questions in the test currently.
Hi - I feel like I need to start out by saying that I'm not a developer, so please forgive me if this is a basic question. I'm just starting out in my developer journey.

In our org, we have some scheduled jobs that I need to modify, but I can't find them. I'm hoping someone can point me in the right direction as to what to look for. 

I've included a screenshot of the types of scheduled jobs I'm talking about, they don't have "Manage" in front of them. Those in the green box I know how to replicate. Those in the red box are the one's I do not. Any help would be appreciated. User-added image
if( ('Closed Won' == o.StageName) && ('Closed Won' != opportunityOldMap.get(o.Id).StageName) && (!o.Line_of_Service__c.contains('Agawam')))
Can someone help me break this IF statement into a nested IF statement so I can add system.debug between the conditions?  Thanks
 

Salesforce have one field on Company information page "API Requests, Last 24 Hours" . It have count of this API requets that is generated on last 24 hours. I want one report that list out all this API requests name and their last run time and status?
Any ideas?
I have to write a criteria for a process. the criteria is 
If the new opportunity is created OR
the Solution_Category__c isblank and ischanged 

can anyone help me in writing the formula for above criteria.

****** Solution_Category__c is a picklist******
I need to send an email to one of two Public Groups depending on the value of the 3 fields in the `If Statement`. Within the the If and Else blocks I have a `String mailGroup` with the value of the Public Class.Now that I need the Else statement to access that private class with a different Public class name, I am having issues inserting `String mailGroup` , into the Private class `getAddresses()`. The Variable `emailAdds` declared at the top holds the email address values from the `getAddresses()` function. Is it my syntax? I am receiving numerous errors:

`Unexpected token 'private'`
 `Unexpected token '<'`
`Unexpected token '>'`

`Method does not exist or incorrect signature: void getAddresses(String) from type CaseHandlerCountAlert`

 
trigger CaseHandlerCountAlert on Case (after insert) {
    
 				String messageToSend;
   				List<String> ListOfMessages = new List<String>();
   		     	Set<Id> AcctIds = new Set<Id>();
				List<String> clientEmail;
				String messageBody;
    			String mailGroup;
    			List<String> emailAdds = getAddresses(mailGroup);
    
List<AggregateResult> AggregateResultList = [SELECT AccountId, Account.Name name, COUNT(Id) co
                                             FROM Case
                                             WHERE CreatedDate = LAST_N_DAYS:1 AND 
                                             Id IN :Trigger.New
                                             GROUP BY AccountId, Account.Name
                                             HAVING COUNT(Id)  >= 5 ];
    		 
            Map<Id, String> accountIdEmailmessageMap = new Map<Id, String>();
            
				for(AggregateResult aggr: AggregateResultList){
                String messageToSend = 'Account name: ' + aggr.get('name') +
                    ' has ' + (Integer)aggr.get('co') +
                    ' cases opened in the last 8 days.';
                Id accId = (Id)aggr.get('AccountId');
                accountIdEmailmessageMap.put(accId,messageToSend);
                AcctIds.add(accId); 
            }
            
			
List<Case> caseList = [SELECT Id, AccountId, Account.Name,Parent_Project_if_applicable__r.Implementation_status__c,
                       Parent_Project_if_applicable__r.PM_Implementation_Status__c, 
                       Parent_Project_if_applicable__r.RCM_Implementation_Status__c,
                       Parent_Project_if_applicable__r.Client_Advisor_Email__c
                       FROM Case
                       WHERE AccountId IN :AcctIds];

for(Case cl:caseList){ 
  
    if(cl.Parent_Project_if_applicable__r.Implementation_status__c == 'Live - Closed Project'||
       cl.Parent_Project_if_applicable__r.PM_Implementation_Status__c == 'Live - Closed Project'||
       cl.Parent_Project_If_Applicable__r.RCM_Implementation_Status__c == 'Live - Closed Project'){    
        	
           	
            mailGroup = 'Customer Success Managers'; 
           
	String messageBody = accountIdEmailmessageMap.get(cl.AccountId);
        
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
	  mail.setSenderDisplayName('IT Support'); 
          mail.setToAddresses(emailAdds);
          mail.Subject = 'Multiple cases created alert message';
          mail.setPlainTextBody(messageBody);
           
         if(messageToSend != null){
          Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
          }
        
    }
    else{  
            
      			
         mailGroup = 'BI Team';
         
        
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
	  mail.SetSenderDisplayName('IT Support');
          mail.setToAddresses(emailAdds);
          mail.Subject = 'Multiple cases created alert message';
          mail.setPlainTextBody(messageToSend);
      
        
        if(messageToSend != null){
          Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
        }
    }
       
         
    }

    


private List<String> getAddresses(mailGroup){
    List<User> UserList =
        [SELECT id, name, email
         FROM User 
         WHERE id 
         IN (SELECT userorgroupid 
             FROM groupmember
             WHERE group.name = :mailGroup)];
    
    List<String> emailString = new List<String>();
    
    for(User u: UserList){
        emailstring.add(u.email);
    }   
    return (emailString);
    //System.debug(emailString);
}    

               }

 
Is there a cost associated with a trial for HealthCloud? I see it as paid in the app exchange
Hi, every morning I am getting these error messages when I log into Salesforce. Could someone please explain to me why this is happening and how I can fix this?

User-added image
Hi everyone,

I created an Apex code in my sandbox (following this link (https://help.salesforce.com/articleView?id=hvs_cadences_auto_remove_targets_process_apex.htm&type=5) and this link (https://help.salesforce.com/articleView?id=changesets_outbound_components_select.htm&type=5)) but cannot get it to upload to my Production Org. Anyone know why it says I am not authorized to do so?

User-added image
Any help is much appreciated!!
Hi,

From a before insert trigger on opportunity, I want to get all the opportunities inserted, find their related contact record and populate a field on the contact record with its associated opportunity record.
It seems like a simple concept, and I know I have to use a Map to achieve this, but to minimize the number of SOQL queries, it becomes real tricky.

Any help would be appreciated!
Parsa