• Lightning Cobra
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Hello,
Contacts are created by users which has a multi select picklist to capture candidates skillset. 
Job records are created by users which has a multi select picklist to capture what skill set is needed. 
Requirement: Whenever a job record is created, based on what skill set is needed the system needs to find the corresponding contacts (candidates) matching atleast 1 skillset and email them job record. 
trigger JobTrigger on Job__c (after insert) {
    
    Set<String> SkillCode = new Set<String>();
    
    // when a new job is posted, based on Skill_Code__c on job record, get matching contact records based on Candi_Skill_Codes__c
    for (Job__c J : Trigger.new) {
        
        // Skill_Code__c is a multi select picklist value
        if (J.Skill_Code__c != null) {
            
            List<String> JobOrderSkillCode = J.Skill_Code__c.split(';');
            SkillCode.addAll(JobOrderSkillCode);

        }
    }

    //Candi_Skill_Codes__c is a multi select picklist value
    for (Contact C : [SELECT Id, Alert__c, Candi_Skill_Codes__c FROM Contact WHERE Candi_Skill_Codes__c INCLUDES (:SkillCode) AND Alert__c = 'Yes']) {
        // Above query returning 0 results
        // If i change the query to something like, 
        // SELECT Id, Alert__c, Candi_Skill_Codes__c FROM Contact WHERE Candi_Skill_Codes__c INCLUDES ('sfdc', 'developer') AND Alert__c = 'Yes'
        // This query returned 2 results
        // I understand bind variables cannot be used with INCLUDES but i also don't know how to proceed in this scenario, please help
        
    }
    
    //Send an email to matched contacts

}
Hello,
I have designed how exceptions will be logged into a custom object in salesforce.I am trying to figure out a way to log severity into that custom object as well. With exception class methods provided by salesforce, i am unable to derive the severity information something like we usually get with apexpages.severity (message class).

Question here is,
1) Can i write the apexpages.severity into the "log" custom object which has a field to capture severity (picklist field with values: Error, Fatal, Warning) along with getCause, getLineNumber, getMessage, getStackTraceString, getTypeName from exception class?
2) If capturing exceptions using exceptions class, how can i get the severity?

Thanks.
Hello,
Contacts are created by users which has a multi select picklist to capture candidates skillset. 
Job records are created by users which has a multi select picklist to capture what skill set is needed. 
Requirement: Whenever a job record is created, based on what skill set is needed the system needs to find the corresponding contacts (candidates) matching atleast 1 skillset and email them job record. 
trigger JobTrigger on Job__c (after insert) {
    
    Set<String> SkillCode = new Set<String>();
    
    // when a new job is posted, based on Skill_Code__c on job record, get matching contact records based on Candi_Skill_Codes__c
    for (Job__c J : Trigger.new) {
        
        // Skill_Code__c is a multi select picklist value
        if (J.Skill_Code__c != null) {
            
            List<String> JobOrderSkillCode = J.Skill_Code__c.split(';');
            SkillCode.addAll(JobOrderSkillCode);

        }
    }

    //Candi_Skill_Codes__c is a multi select picklist value
    for (Contact C : [SELECT Id, Alert__c, Candi_Skill_Codes__c FROM Contact WHERE Candi_Skill_Codes__c INCLUDES (:SkillCode) AND Alert__c = 'Yes']) {
        // Above query returning 0 results
        // If i change the query to something like, 
        // SELECT Id, Alert__c, Candi_Skill_Codes__c FROM Contact WHERE Candi_Skill_Codes__c INCLUDES ('sfdc', 'developer') AND Alert__c = 'Yes'
        // This query returned 2 results
        // I understand bind variables cannot be used with INCLUDES but i also don't know how to proceed in this scenario, please help
        
    }
    
    //Send an email to matched contacts

}