Skip to main content

Notifications

Announcements

No record found.

Service | Customer Service, Contact Center, Fie...
Suggested answer

How do we identify if the lookup field is multiple reference field?

Posted on by Microsoft Employee

Hi Team ,

 I want to know any Rest API to identify if the lookup field is multiple reference field ?

I used this below API to get field attributes :  /api/data/v9.1/EntityDefinitions(LogicalName%20=%20'phonecall')/Attributes , i didn't identify the field is multiple reference from the API response.

Can anyone help to find out multiple reference fields for the form like Phonecall ( To field ) ?

test.png

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How do we identify if the lookup field is multiple reference field?

    Thanks . In this document - Partlist lookup allow multiple reference to multiple entities. docs.microsoft.com/.../types-of-fields

    But Call "from" allow single entity only and "to" allow multiple entities. how do we differentiate it from api response ?

  • LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: How do we identify if the lookup field is multiple reference field?

    Hi partner,

    What does "multiple reference fields" mean? If you mean the field like "Call To" which could store multiple records in lookup filed, it is actually Party List field as I mentioned before.

    And if you want to identify them, the default party list fields are list in the link I provided in my last answer.

    And if you want to identify them by code, you could also use the web api to retrieve the attribute type as I mentioned in my last answer also.

    If my understanding is not correct, please feel free to let me know.

    Regards,

    Leo

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How do we identify if the lookup field is multiple reference field?

    Thanks for your reply. Is there any multiple reference fields in MSDynamics? If yes , how do we identify?

  • Suggested answer
    LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: How do we identify if the lookup field is multiple reference field?

    Hi partner,

    Actually, the From and To field are not lookup fields, they are "Party List" fields.

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

    pastedimage1591839628228v1.png

    And we could use REST API to retrieve attribute type in Metedata.

    For example, I want to get all Party List fields in Phone call entity, I will use this request.

    GET [Organization URI]/api/data/v9.0/EntityDefinitions(LogicalName='phonecall')?$select=LogicalName&$expand=Attributes($select=LogicalName;$filter=AttributeType eq Microsoft.Dynamics.CRM.AttributeTypeCode'PartyList')

    pastedimage1591839776932v2.png

    https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/query-metadata-web-api#querying-entitymetadata-attributes

    pastedimage1591839803530v3.png

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/attributetypecode?view=dynamics-ce-odata-9

    And here is the result.

    pastedimage1591839877306v4.png

    And if you want to check a special field if it is party List field, you could use this request.

    GET [Organization URI]/api/data/v9.0/EntityDefinitions(LogicalName='account')/Attributes(5967e7cc-afbb-4c10-bf7e-e7ef430c52be)/Microsoft.Dynamics.CRM.PartyListAttributeMetadata?$select=LogicalName&$expand=OptionSet 
    pastedimage1591839972618v5.png

    https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/query-metadata-web-api#retrieving-attributes

    Best Regards,

    Leo

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans