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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

How to get 'Call From' and 'Call To' of all phone call in WEB API

(1) ShareShare
ReportReport
Posted on by 32

In OrganizationService, I can easily get the 'Call From' and 'Call To' of phone call by using columns 'From' and 'To' , either thought fetch XML, or using RetrieveEntityRequest, it's quite straight forward.

but in Dynamics 365 WEB API, these two columns not returned, need using $expand or link-entities in fetch xml, is there any other ways to get these two columns ?

I have the same question (0)
  • Suggested answer
    cloflyMao Profile Picture
    25,210 on at

    Hi Flex Xuan,

    'Call From' and 'Call To' are party list type field, they will be saved as separate activityparty entity records.

    In other word, there will be two activityparty records for a phone call record. 

    We should instead expand activityid_phonecall property to show fields of related phone call record.

    e.g:

    display 'Call From' and 'Call To' field of a specific phone call record:

    var entityId = 'xxxx'; // phone call record id
    Xrm.WebApi.retrieveMultipleRecords("activityparty", "?$expand=activityid_phonecall($select=subject)&$filter=_activityid_value eq "   entityId 
                  " and (participationtypemask eq 1 or participationtypemask eq 2)&$select=_partyid_value,_activityid_value,participationtypemask").then(
        function success(result) {
            for (var item in result.entities) {
                if (result.entities[item]["participationtypemask"] === 1) {
                    console.log("Phone call activity: "   result.entities[item]["_activityid_value"]   ", Subject: "   result.entities[item]["activityid_phonecall"]["subject"]   ", Call From: "   result.entities[item]["_partyid_value@OData.Community.Display.V1.FormattedValue"]);
                } else if (result.entities[item]["participationtypemask"] === 2) {
                    console.log("Phone call activity: "   result.entities[item]["_activityid_value"]   ", Subject: "   result.entities[item]["activityid_phonecall"]["subject"]   ", Call To: "   result.entities[item]["_partyid_value@OData.Community.Display.V1.FormattedValue"]);
                }
            }
        },
        function (error) {
            console.log(error.message);
        }
    );

    pastedimage1587457342646v1.png

    If activity entity is "PhoneCall", then when participationtypemask field of activityparty record equals to 1, it stands for Call From,

    when the field equals to 2, it stands for Call To.

    In a word, we should retrieve phone call based on activityparty entity.

    Furthermore, we can also retrieve "From" and "To" fields of Email based on it.

    Here are some helpful links about your question:

    1. participationtypemask code meaning for different activity entities:

    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/activityparty-entity

    2. available properties to expand of activityparty entity:

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/activityparty?view=dynamics-ce-odata-9#single-valued-navigation-properties

    3. a tutorial about the topic:

    https://promx.net/en/2020/01/how-to-retrieve-an-activity-party-list-in-microsoft-dynamics-365-using-web-api/

    Regards,

    Clofly

  • cloflyMao Profile Picture
    25,210 on at

    Hi Flex Xuan,

    Please kindly let me know whether it could work for you. Thanks.

    Regards,

    Clofly

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 > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 180 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 123

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans