Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Retrieving altKey from online crm using Web API

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi

I have a requirement that, i need to retrieve altkey(s) of entities (or a particular entity) using web API. By using query

GET [Organization URI]/api/data/v9.0/accounts

iam able to get records of account but not altkey, if i use metadata query also iam unable to fetch it.

Please help me out here, to retrieve altkey(s) of entity(s).

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Retrieving altKey from online crm using Web API

    If i use Query

    /api/data/v9.1/$metadata#Keys/$Entity

    iam able to fetch field names for which i have created alternate keys

    example

    Annotation Term="OData.Community.Keys.V1.AlternateKeys">
    
    <Collection>
    
    <Record Type="OData.Community.Keys.V1.AlternateKey">
    
    <PropertyValue Property="Key">
    
    <Collection>
    
    <Record Type="OData.Community.Keys.V1.PropertyRef">
    
    <PropertyValue Property="Alias" String="name"/>
    
    <PropertyValue Property="Name" PropertyPath="name"/>
    
    </Record>
    
    </Collection>
    
    </PropertyValue>
    
    </Record>
    
    </Collection>
    
    </Annotation>.

    But my requirement is to get the name of alternate key example new_account , new_(name of alternate key user have given),

    Please help me out here

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Retrieving altKey from online crm using Web API

    Thanks for the Response.

    If i use query     /api/data/v9.0/EntityKeyDefinitions     web API is throwing an error like

    Resource not found for the segment 'EntityKeyDefinitions'.

    If i use /api/data/v9.0/EntityMetadata also iam getting same error.

    EntityDefinitions is working but in that there is no property for getting Keys.


    Can you please send the query that works fine for Retrieving Alternate Keys.

     

  • Suggested answer
    Kokulan Profile Picture
    Kokulan 18,052 on at
    RE: Retrieving altKey from online crm using Web API

    Hi

    You have to use the Keys attribute of EntityMetadata

    docs.microsoft.com/.../microsoft.xrm.sdk.metadata.entitymetadata.keys

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans