web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)
Suggested Answer

FetchXML to get email CC email addresses

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Suggested answer
    ScottDurow Profile Picture
    21 on at

    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>

  • Community Member Profile Picture
    on at

    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?

  • Community Member Profile Picture
    on at

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans