Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Using Alternate Keys to update Lookup field using Web API

Posted on by 122 User Group Leader

Has anyone been successful in using alternate keys to update a lookup field when using web API?

I'm searching for examples online but can only see where the GUID is used. 

*This post is locked for comments

  • TriciaSin Profile Picture
    TriciaSin 122 User Group Leader on at
    RE: Using Alternate Keys to update Lookup field using Web API

    It works in SP1 using the syntax provided by Martjn.

  • Suggested answer
    M.T. Eikelenboom Profile Picture
    M.T. Eikelenboom 5,241 on at
    RE: Using Alternate Keys to update Lookup field using Web API

    Does this blog post help: www.oak3.org/.../using-alternate-keys-webapi

    I think it's the same issue you are referring to and after I figured out how to use it, I wrote a blog post on the subject.

    It would look something like this to set a lookup value using the alternate key 'blg_alternatekey':

    url: /api/data/v8.2/contacts
    method: POST
    body: {
    	"firstname" : "john",
    	"lastname" : "smith",
    	"parentcustomerid_account@odata.bind" : "/accounts(blg_alternatekey='blg12345')"
    }


  • Suggested answer
    Yadnyesh Kuvalekar Profile Picture
    Yadnyesh Kuvalekar 4,102 on at
    RE: Using Alternate Keys to update Lookup field using Web API

    This should solve your query.

    msdn.microsoft.com/.../dn932140.aspx

  • RE: Using Alternate Keys to update Lookup field using Web API

    Dude, Have you tried to set Lookup field using Alternate Key? Kindly Suggest.

  • RE: Using Alternate Keys to update Lookup field using Web API

    Hi

    Did you find any solution for the same? I am facing the same issue and need to set Lookup field using Alternate Key.

    Thanks,

    Rahul

  • TriciaSin Profile Picture
    TriciaSin 122 User Group Leader on at
    RE: Using Alternate Keys to update Lookup field using Web API

    Thanks! But is there a way to update a lookup field via alternate keys instead of the GUID?

    That link allows the update of a record via an alternate key...

  • Verified answer
    Yadnyesh Kuvalekar Profile Picture
    Yadnyesh Kuvalekar 4,102 on at
    RE: Using Alternate Keys to update Lookup field using Web API

    Please have a look in below blog:

    [View:http://www.inogic.com/blog/2016/10/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api/]

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans