• Scott Kostojohn
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies

I am trying to create a before-insert trigger on EmailMessage, so that when a user logs an email from the Outlook Integration, I can set the RelatedToId field based on the email sender (FromAddress).

What I am finding in my testing, however, is that both FromAddress and ValidatedFromAddress are NULL on insert! Perhaps due to how the Outlook Integration inserts email records - perhaps it follows up the insert with an update to populate the FromAddress field.

Unfortunately, I must put my logic in the before-insert - you are only allowed to set RelatedToId on insert.

(1) Do any of you have more details around the behavior of the Outlook Integration and the From fields that might help me?

(2) Can anyone see another solution to be able to programmatically set the RelatedToId for tracked emails, based on the sender, other than my approach of the before-insert trigger on EmailMessage?

I have considered moving my logic to an after insert, and trying to delete the original email and recreate it with all the right information, but that seems extreme and I am concerned about the impact the changing id (due to delete and create new) will have on the Outlook Integration.

Thanks to all for any help you can provide!
Scott Kostojohn
Hi Everyone!!

I am looking for help on the integration of Salesforce with Amazon-SQS , this is to enable Salesforce to read the messages from SQS and process them. Over the web i can only find 3rd Party Apps that will be enable us to integrate SF and SQS , does any one have any experience on acheiving this through custom code in apex?

Any help or pointers on this is highly appreciated.

Thanks,
How do i separate strings in a Text field??

"Taha Haider"

I want break this name into 2 sections.

1:Taha
2:Haider

I am trying to create a before-insert trigger on EmailMessage, so that when a user logs an email from the Outlook Integration, I can set the RelatedToId field based on the email sender (FromAddress).

What I am finding in my testing, however, is that both FromAddress and ValidatedFromAddress are NULL on insert! Perhaps due to how the Outlook Integration inserts email records - perhaps it follows up the insert with an update to populate the FromAddress field.

Unfortunately, I must put my logic in the before-insert - you are only allowed to set RelatedToId on insert.

(1) Do any of you have more details around the behavior of the Outlook Integration and the From fields that might help me?

(2) Can anyone see another solution to be able to programmatically set the RelatedToId for tracked emails, based on the sender, other than my approach of the before-insert trigger on EmailMessage?

I have considered moving my logic to an after insert, and trying to delete the original email and recreate it with all the right information, but that seems extreme and I am concerned about the impact the changing id (due to delete and create new) will have on the Outlook Integration.

Thanks to all for any help you can provide!
Scott Kostojohn