Hi,
I need help with the following:
I have already got the email to Case OOB process to work. The incoming email contains some custom field values within its body. I am trying to intercept the process, parse email body and set those values on Case. I have looked at many online posts but still having trouble to get this to work.
I registered my plugin on Create of Email but the regardingobjectid which should reference the Case says the given key is not present in data dictionary... so basically the email does not contain that attribute. Do you have any advice in terms of the best approach for doing this? Would it be a good idea to register the plugin on Case instead of Email? Any other suggestions? Any references to how to parse the email body would be helpful too.
Thank you so much in advance. Looking forward to your response.
August
Hi,
Your solution by adding a custom field to the case and copying the email body to it I believe is excellent. As you know, I still have to get rid of the html tags and do a lot of parsing but I think this should achieve what I am looking for. Thank you again. I really appreciate your help.
Hi,
you also can do below things, then you can set the plugin trigger on email update. but i personally dont prefer this method, because what if there are multiple emails available, then you have to write additional code to check.
Hi,
That is why we have second options, copy the email body message to a custom field in Case.
Hi,
It seems like this is not going to work. When the plugin triggers on create of case from email the regarding field of email has not been set yet. The case gets created and then the regarding field is set on email so it seems like we cannot register the plugin on create of case.
I can't thank you enough. Thank you so much for all your help Fun Wei Jie.
August
Hi,
if you are using automatic create and update rule, yes do it there , you can map it from there
Hi,
How do I set the email body text to a custom field on Case. I can create a custom hidden field on Case but how do I map it to email body? Do it through Record Creation and Update Rule workflow?
Hi ,
yes, you are right,
but you also can save the effort by setting the email body text into one of the field in Case. ( I personally would prefer this method)
Hi,
pass in the case guid into "passinthecaseid", refer below link on how to construct the query using fetchxml
[View:https://msdn.microsoft.com/en-us/library/gg328117.aspx:750:50]
Sample code ( please read through the above link)
<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
<entity name='email'>
<attribute name='subject' />
<attribute name='regardingobjectid' />
<attribute name='from' />
<attribute name='to' />
<attribute name='prioritycode' />
<attribute name='statuscode' />
<attribute name='modifiedon' />
<attribute name='activityid' />
<attribute name='description' />
<order attribute='subject' descending='false' />
<filter type='and'>
<condition attribute='regardingobjectid' operator='eq' value = '"+passinthecaseid+"' />
</filter>
</entity>
</fetch>
I think I know what you mean now. So you are saying that I register the plugin on Case. Then within the plugin search for emails where the regarding field is set to this case and retrieve the email from there. Am I right?