Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Which name to be used to update a custom entity with lookup field

Posted on by 45

Hi,

I would like to know what to send in request for lookup field for inserting an entity to Microsoft CRM.

If I post a request to http://<server url>/api/data/v9.1/new_my_activities

with body

{"new_id":"abc-def","new_my_opportunityID@odata.bind":"/opportunities(2b685c81-4f1c-e511-80d3-3863bb347ba8)"}

Here new_my_opportunityID is my schema name for lookup entity, what I would like to confirm is do we use schema name, logical name or Navigation property name here?

SchemaName worked for me but some where it was suggested to use navigation property?

Could someone please confirm which name is used in rest request for lookup field?

  • User KS Profile Picture
    User KS 45 on at
    RE: Which name to be used to update a custom entity with lookup field

    When you go to customization->developer resources->download ODataV4Metadata you will get an xml with something like below for the attribute:

    <NavigationProperty Name="new_my_opportunityID" Type="mscrm.opportunity" Nullable="false" Partner="new_opportunity_new_my_activity_my_opportunityID"><ReferentialConstraint Property="_new_my_opportunityid_value" ReferencedProperty="opportunityid" /></NavigationProperty>

  • Suggested answer
    chris xu Profile Picture
    chris xu on at
    RE: Which name to be used to update a custom entity with lookup field

    Below is a sample screenshot of one lookup type field, I did not find the mentioned navigation property name - could you please share your screenshot if required and applicable?

    Annotation-2020_2D00_05_2D00_19-145513.png

  • User KS Profile Picture
    User KS 45 on at
    RE: Which name to be used to update a custom entity with lookup field

    When we check the metadata for our account we can go to the attribute which is lookup field. There we have a navigation property name.

  • Suggested answer
    chris xu Profile Picture
    chris xu on at
    RE: Which name to be used to update a custom entity with lookup field

    Hi User -

    Using the schemename works in your scenario.

    what does "navigation property" mean here?

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