You need to sign in to do that
Don't have an account?
EmailMessage - BCcAddress field is not visible in standard page layout
I have created email-to-case also wrote a trigger(before and after insert) in EmailMessage Object, when I'm trying to access "BCcaddress" field in trigger level it gives NULL value even though I have sent an email by marking BCc to someone, also that field is not visible in EmailMessage standard page layout.
Do anyone have solution for this? I need to get "BCcaddress" field value in Trigger level.
here my code:
for(EmailMessage irow : trigger.new){
if(irow.Incoming){
system.debug(' Toaddress -> '+ irow.Toaddress + ' BCcaddress -> '+ irow.BCcaddress + ' Ccaddress -> '+ irow.Ccaddress + ' Fromaddress -> '+ irow.Fromaddress);
}}
Inbound Email Message does not support BCC Addres,this is why you are not able able to see in page layout too.
I am assuming you have configured both ,To address and BCC Address in email to case configuration.
After you configured email to case and sending email to particular email id's configured through email to case ,it will create individual case for TO address as well as BCC address.
for example: To Address : test@gmail.com , BCC Address: test1@gmail.com
In SF, Case number - #00100 gets created for test@gmail.com and Case number - #00101 gets created for test1@gmail.com.
Reason being,you have configured email to case both the email id.
For Outbound Email Message, supports BCC address field,that is the reason it is visible in page layout and when you replying for a particular case and put a BCC address, it will capture in Outbound Email Message.
You can test with the following code(for outbound email):
for(EmailMessage irow : trigger.new){
if(irow.Incoming == false){
system.debug( ' BCcaddress -> '+ irow.BCcaddress);
}
}
you can able to see values of irow.BCcaddress.
Please let me know if you have any doubts.
Cheers,
Dhriti