• Eric Fischl
  • NEWBIE
  • 25 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 5
    Replies
Hi, I'm trying to validate against the Summer '23 REST API v30 requirement and I see one item in the Event Logs that calls /v30.0/connect/communities when logging into an Experience Site ... I have no idea where this is coming from, as we're not using anything custom or 3rd party, just canned SF functionality.
So my question is twofold: 1) do I need to do something to update this before the API retirement, and/or 2) how do I track down what that is.

Thanks in advance for any help.
Hi, simple question here that's stumping me: I have a trigger on EmailMessage that I only want to fire if a checkbox on the related Case object = True. Trolling the forums has got me close but I'm still missing something ... any help greatly appreciated! Incomplete code snippet:
trigger EmailMessageCopyToCaseComments on EmailMessage (after insert) {
for(email e : [Select Initial_Email_Received__c From Case Where Id = :email.parentID    {
    if(!c.Initial_Email_Received__c = 'TRUE' {
           EmailMessageCopyToCaseCommentsTrigger.copyEmailMessagesToCaseComments(Trigger.new);}
}

 
Hey all, I'm absolutely NOT a developer so this is probably straightforward ... looking for some help on trigger code. Basically I need to catch if an incoming email does NOT have a user record. This works as expected if the email has a user attached to it, posts correctly, but the else statement just never happens if the user does not exist, throws a list exception error. What am I doing wrong? Thanks!
 
public class EmailMessageCopyToCaseCommentsTrigger
{
    public static void copyEmailMessagesToCaseComments(List<EmailMessage> emails)
    {
        List<CaseComment> comments = new List<CaseComment>();
        for (EmailMessage email:emails)
        {
            Id caseId = email.ParentId;
            CaseComment comment = new CaseComment(ParentId=caseId);
            comment.IsPublished=true;
           Id UserDetails = [select id from user where email = :email.FromAddress].get(0).Id;
           String strId=Id.valueOf(UserDetails);
            if (!string.isEmpty(strId)){
                    comment.CreatedbyID = UserDetails;}
            else {comment.CreatedbyID = '0054x000005MWmAAAW';}
               
            String header = 'From: '+ email.FromName + ' <' + email.FromAddress + '>\n';
            header += 'To: '+ email.ToAddress + '\n';
            header += email.CcAddress!=null?'CC: '+ email.CcAddress + '\n\n':'\n';
            if (email.TextBody!=null) {
                comment.CommentBody = header + email.TextBody;
            } else if (email.HtmlBody!=null) {
                comment.CommentBody = header + email.HtmlBody.replaceAll('\\<.*?>','');
            }
            
            comments.add(comment);
        }
        
        if (!comments.isEmpty())
        {
            insert comments;
        }
    }

 
Hi, I'm trying to validate against the Summer '23 REST API v30 requirement and I see one item in the Event Logs that calls /v30.0/connect/communities when logging into an Experience Site ... I have no idea where this is coming from, as we're not using anything custom or 3rd party, just canned SF functionality.
So my question is twofold: 1) do I need to do something to update this before the API retirement, and/or 2) how do I track down what that is.

Thanks in advance for any help.
Hi, simple question here that's stumping me: I have a trigger on EmailMessage that I only want to fire if a checkbox on the related Case object = True. Trolling the forums has got me close but I'm still missing something ... any help greatly appreciated! Incomplete code snippet:
trigger EmailMessageCopyToCaseComments on EmailMessage (after insert) {
for(email e : [Select Initial_Email_Received__c From Case Where Id = :email.parentID    {
    if(!c.Initial_Email_Received__c = 'TRUE' {
           EmailMessageCopyToCaseCommentsTrigger.copyEmailMessagesToCaseComments(Trigger.new);}
}

 
Hey all, I'm absolutely NOT a developer so this is probably straightforward ... looking for some help on trigger code. Basically I need to catch if an incoming email does NOT have a user record. This works as expected if the email has a user attached to it, posts correctly, but the else statement just never happens if the user does not exist, throws a list exception error. What am I doing wrong? Thanks!
 
public class EmailMessageCopyToCaseCommentsTrigger
{
    public static void copyEmailMessagesToCaseComments(List<EmailMessage> emails)
    {
        List<CaseComment> comments = new List<CaseComment>();
        for (EmailMessage email:emails)
        {
            Id caseId = email.ParentId;
            CaseComment comment = new CaseComment(ParentId=caseId);
            comment.IsPublished=true;
           Id UserDetails = [select id from user where email = :email.FromAddress].get(0).Id;
           String strId=Id.valueOf(UserDetails);
            if (!string.isEmpty(strId)){
                    comment.CreatedbyID = UserDetails;}
            else {comment.CreatedbyID = '0054x000005MWmAAAW';}
               
            String header = 'From: '+ email.FromName + ' <' + email.FromAddress + '>\n';
            header += 'To: '+ email.ToAddress + '\n';
            header += email.CcAddress!=null?'CC: '+ email.CcAddress + '\n\n':'\n';
            if (email.TextBody!=null) {
                comment.CommentBody = header + email.TextBody;
            } else if (email.HtmlBody!=null) {
                comment.CommentBody = header + email.HtmlBody.replaceAll('\\<.*?>','');
            }
            
            comments.add(comment);
        }
        
        if (!comments.isEmpty())
        {
            insert comments;
        }
    }