You need to sign in to do that
Don't have an account?

get the case owner id to match the User checkbox field and send email
Hi,
I am having 2 objects case and UserObject<No relationship between them>
In User object i have Checkbox field which will be checked to true/false by the corresponding user.
I m trying to check whether the CaseOwner Id of the particular case has User chexkbox field checked <in the User Object> and if so an email message will be sent.
trigger EmailMessageAfterUpdate on EmailMessage (after insert) {
for(EmailMessage eMsg : Trigger.new) {
User u = new User();
List<Case> c = [SELECT id,ownerId, Description, caseNumber FROM Case WHERE Id = :eMsg.ParentId ];
}
Can someone let me know how to proceed?
Thanks
I am having 2 objects case and UserObject<No relationship between them>
In User object i have Checkbox field which will be checked to true/false by the corresponding user.
I m trying to check whether the CaseOwner Id of the particular case has User chexkbox field checked <in the User Object> and if so an email message will be sent.
trigger EmailMessageAfterUpdate on EmailMessage (after insert) {
for(EmailMessage eMsg : Trigger.new) {
User u = new User();
List<Case> c = [SELECT id,ownerId, Description, caseNumber FROM Case WHERE Id = :eMsg.ParentId ];
}
Can someone let me know how to proceed?
Thanks
thanks for the reply
i have a custom field called out_of_office_ c on the user object<checkbox field>
[SELECT id,ownerId,Description,caseNumber,Owner.Name FROM Case WHERE Id = :eMsg.ParentId and owner.out_of_office__c = true]
i am getting no such column on entity error.
However i am able to get the standard field values like:
[select id,owner.isactive from case]
can u please advise
Out_of_Office_Email_Address__c --Email field
Out_of_office__c -- checkbox field
I am writing a trigger on email message which will check whether the out_of_office checkbox is checked and will send an OOO reply through workflow
My requirement is:
Fetch the Case Owner based on the parent ID of the email address.
Check if Out of Office flag is set for the user in the User Object.
Updates the Out_of_Office_Email_Address__c in User Object with the FromAddress in EmailMessageObject.
Thanks
sathish