Hi, can anyone help me with a fetchXML query? I am getting a list of email message fields. the purpose is to display the actual to / from / cc / bcc email addresses in a form via a webresource.
I have the fetch XML working, but get activityparty: and a guid for cc and bcc.
my simplified (I've removed a couple of conditions) fetchXML so far is:
<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false' >
<entity name='email' >
<attribute name='sender' />
<attribute name='torecipients' />
<attribute name='subject' />
<attribute name='senton' />
<attribute name='cc' />
</entity>
</fetch>
*This post is locked for comments
in case anyone is interested, I have taken the approach of getting all the activity party records via fetch XML, then looping through them in JS to create strings for to, cc, bcc. slightly messy, but works and gives the user what the want.
Hi Scott, thanks for the reply and sorry for the late one myself.
With what I am trying to do - show the email addresses for the
From
to
CC
BCC
I though using the email entity fields was correct, but as I found CC and BCC are not there.
As I need to get CC addresses and probably the BCC as well, i'll just do a single fetchXML for CC (3) and BCC(4). To be more correct should I also get the To (2) and Sender (1) addresses from the activityparty entity or use the email.torecipients and email.sender fields still?
You will need to join to the Activity Party for CC participation type code to get the partyid:
<fetch mapping="logical" output-format="xml-platform" version="1.0" distinct="true">
<entity name="activitypointer">
<attribute name="activitytypecode" />
<attribute name="subject" />
<attribute name="activityid" />
<link-entity name="activityparty" to="activityid" from="activityid" alias="aa">
<filter type="and">
<condition value="3" attribute="participationtypemask" operator="eq" /> <!-- CC activity parties -->
</filter>
<attribute name="partyid"/>
<attribute name='participationtypemask'/>
</link-entity>
</entity>
</fetch>
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156