How to retrieve addresses using the odata endpointASP.NET WebAPI: Generic controller for OData endpointodata filtering based on the property of a relationAccount entity and More address entity in MS CRM 2011OData Expand override Entity Framework includesMicrosoft Dynamics CRM - What is the OData url format to retrieve label of two option set attributes of an entity?Retrieving CRM OptionSet field using Simple.odata.client libraryWhich C# OData Client library to use for Dynamics CRM 365 Web Api?How do I use $expand on ownerid to fetch SystemUser properties with the Dynamics 365 Web API?Property 'field' on type 'Microsoft.Dynamics.CRM.entity' is not a navigation property or complex property. Only navigation properties can be expandedCannot retrieve selected lookups using the OData endpoint

Meaning of じゃないんじゃない?

What's the easiest way for a whole party to be able to communicate with a creature that doesn't know Common?

What was the impact of Fischer vs. Spassky 1972 on the relationship between the USA and the Soviet Union?

Chords behaving as a melody

Symbol for "not absolutely continuous" in Latex

One folder having two different locations on Ubuntu 18.04

What's the rule for a natural 20 on a Perception check?

Procedurally generate regions on island

Adjective for 'made of pus' or 'corrupted by pus' or something of something of pus

Is it legal to call shared_future::get() multiple times on the same instance in the same thread?

Why would anyone even use a Portkey?

Why does the same classical piece sound like it's in a different key in different recordings?

Donkey as Democratic Party symbolic animal

Are these intended activities legal to do in the USA under the VWP?

How would an order of Monks that renounce their names communicate effectively?

How is this practical and very old scene shot?

Most elegant way to write a one shot IF

Why STP has to be disable on Trunk Ports?

Are all commands with an optional argument fragile?

In native German words, is Q always followed by U, as in English?

Why do we use a cylinder as a Gaussian surface for infinitely long charged wire?

Was it really unprofessional of me to leave without asking for a raise first?

Is it okay to fade a human face just to create some space to place important content over it?

I hit a pipe with a mower and now it won't turn



How to retrieve addresses using the odata endpoint


ASP.NET WebAPI: Generic controller for OData endpointodata filtering based on the property of a relationAccount entity and More address entity in MS CRM 2011OData Expand override Entity Framework includesMicrosoft Dynamics CRM - What is the OData url format to retrieve label of two option set attributes of an entity?Retrieving CRM OptionSet field using Simple.odata.client libraryWhich C# OData Client library to use for Dynamics CRM 365 Web Api?How do I use $expand on ownerid to fetch SystemUser properties with the Dynamics 365 Web API?Property 'field' on type 'Microsoft.Dynamics.CRM.entity' is not a navigation property or complex property. Only navigation properties can be expandedCannot retrieve selected lookups using the OData endpoint






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I'm trying to retrieve an address on a standard entity.



the request is the following :



https://mycrm.api.crm4.dynamics.com/api/data/v9.1/contacts(guid)


In this example, I get all fields, but the ones that is of interest to me is address1_addressid, which seems to be a Guid, referencing some of record, but I cannot find it in the "Many to One" relationship list I retrieved using the following command :



https://mycrm.api.crm4.dynamics.com/api/data/v9.1/EntityDefinitions(LogicalName='contact')?$select=LogicalName&$expand=ManyToOneRelationships($select=ReferencingAttribute,ReferencedEntity)


I would like to retrieve those addresses in a generic manner, as I'm working on a generic NetStandard 2.0 library. I won't be able to know on which entity I'll be working, and thus won't be able to hard-code a list of addresses field names.










share|improve this question




























    0















    I'm trying to retrieve an address on a standard entity.



    the request is the following :



    https://mycrm.api.crm4.dynamics.com/api/data/v9.1/contacts(guid)


    In this example, I get all fields, but the ones that is of interest to me is address1_addressid, which seems to be a Guid, referencing some of record, but I cannot find it in the "Many to One" relationship list I retrieved using the following command :



    https://mycrm.api.crm4.dynamics.com/api/data/v9.1/EntityDefinitions(LogicalName='contact')?$select=LogicalName&$expand=ManyToOneRelationships($select=ReferencingAttribute,ReferencedEntity)


    I would like to retrieve those addresses in a generic manner, as I'm working on a generic NetStandard 2.0 library. I won't be able to know on which entity I'll be working, and thus won't be able to hard-code a list of addresses field names.










    share|improve this question
























      0












      0








      0








      I'm trying to retrieve an address on a standard entity.



      the request is the following :



      https://mycrm.api.crm4.dynamics.com/api/data/v9.1/contacts(guid)


      In this example, I get all fields, but the ones that is of interest to me is address1_addressid, which seems to be a Guid, referencing some of record, but I cannot find it in the "Many to One" relationship list I retrieved using the following command :



      https://mycrm.api.crm4.dynamics.com/api/data/v9.1/EntityDefinitions(LogicalName='contact')?$select=LogicalName&$expand=ManyToOneRelationships($select=ReferencingAttribute,ReferencedEntity)


      I would like to retrieve those addresses in a generic manner, as I'm working on a generic NetStandard 2.0 library. I won't be able to know on which entity I'll be working, and thus won't be able to hard-code a list of addresses field names.










      share|improve this question














      I'm trying to retrieve an address on a standard entity.



      the request is the following :



      https://mycrm.api.crm4.dynamics.com/api/data/v9.1/contacts(guid)


      In this example, I get all fields, but the ones that is of interest to me is address1_addressid, which seems to be a Guid, referencing some of record, but I cannot find it in the "Many to One" relationship list I retrieved using the following command :



      https://mycrm.api.crm4.dynamics.com/api/data/v9.1/EntityDefinitions(LogicalName='contact')?$select=LogicalName&$expand=ManyToOneRelationships($select=ReferencingAttribute,ReferencedEntity)


      I would like to retrieve those addresses in a generic manner, as I'm working on a generic NetStandard 2.0 library. I won't be able to know on which entity I'll be working, and thus won't be able to hard-code a list of addresses field names.







      dynamics-crm odata dynamics-crm-365






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 25 at 13:24









      DremorDremor

      3801 gold badge3 silver badges17 bronze badges




      3801 gold badge3 silver badges17 bronze badges






















          1 Answer
          1






          active

          oldest

          votes


















          2














          Here's one way to find the Contact to Address relationship:



          https://myOrg.api.crm.dynamics.com/api/data/v9.1/EntityDefinitions(LogicalName='customeraddress')?$select=LogicalName&$expand=ManyToOneRelationships($select=ReferencingAttribute,ReferencedEntity)



          AddressRelationship



          I got an error with https://myOrg.api.crm.dynamics.com/api/data/v9.1/contacts(guid)?$expand=address1_addressid.



          I looked into the MetaData and discovered that address1_addressid has a type of Primary Key:
          PrimaryKey



          While a normal lookup field has a type of Lookup:
          Lookup



          Considering the error message that appears when attempting to expand address1_addressid, I think the issue is address1_addressid's data type.




          Property 'address1_addressid' on type 'Microsoft.Dynamics.CRM.contact'
          is not a navigation property or complex property. Only navigation
          properties can be expanded.




          It would seem that rather than using $expand to get the address details, you'd have to make a separate call for it:
          https://myOrg.api.crm.dynamics.com/api/data/v9.1/customeraddresses(guid)



          UPDATE

          By reviewing the full Contact-Address relationship, via this query: https://myOrg.api.crm.dynamics.com/api/data/v9.1/EntityDefinitions(LogicalName='customeraddress')?$select=LogicalName&$expand=ManyToOneRelationships.



          I discovered the ReferencedEntityNavigationPropertyName was set to Contact_CustomerAddress.



          fullRelationship



          The error message before talked about the Navigation property so I gave it a shot. Using that property named allowed me to expand the Address info from the Contact:



          https://myOrg.api.crm.dynamics.com/api/data/v9.1/contacts(guid)?$expand=Contact_CustomerAddress



          Interestingly, expanding that navigation property returns all 3 customer addresses:
          Addresses






          share|improve this answer

























          • Thank (again ;) ) Aron, will try this as soon as I've time.

            – Dremor
            Mar 25 at 14:33











          • You're welcome @Dremor. I found out more and updated the answer.

            – Aron
            Mar 25 at 18:06











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55338836%2fhow-to-retrieve-addresses-using-the-odata-endpoint%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          Here's one way to find the Contact to Address relationship:



          https://myOrg.api.crm.dynamics.com/api/data/v9.1/EntityDefinitions(LogicalName='customeraddress')?$select=LogicalName&$expand=ManyToOneRelationships($select=ReferencingAttribute,ReferencedEntity)



          AddressRelationship



          I got an error with https://myOrg.api.crm.dynamics.com/api/data/v9.1/contacts(guid)?$expand=address1_addressid.



          I looked into the MetaData and discovered that address1_addressid has a type of Primary Key:
          PrimaryKey



          While a normal lookup field has a type of Lookup:
          Lookup



          Considering the error message that appears when attempting to expand address1_addressid, I think the issue is address1_addressid's data type.




          Property 'address1_addressid' on type 'Microsoft.Dynamics.CRM.contact'
          is not a navigation property or complex property. Only navigation
          properties can be expanded.




          It would seem that rather than using $expand to get the address details, you'd have to make a separate call for it:
          https://myOrg.api.crm.dynamics.com/api/data/v9.1/customeraddresses(guid)



          UPDATE

          By reviewing the full Contact-Address relationship, via this query: https://myOrg.api.crm.dynamics.com/api/data/v9.1/EntityDefinitions(LogicalName='customeraddress')?$select=LogicalName&$expand=ManyToOneRelationships.



          I discovered the ReferencedEntityNavigationPropertyName was set to Contact_CustomerAddress.



          fullRelationship



          The error message before talked about the Navigation property so I gave it a shot. Using that property named allowed me to expand the Address info from the Contact:



          https://myOrg.api.crm.dynamics.com/api/data/v9.1/contacts(guid)?$expand=Contact_CustomerAddress



          Interestingly, expanding that navigation property returns all 3 customer addresses:
          Addresses






          share|improve this answer

























          • Thank (again ;) ) Aron, will try this as soon as I've time.

            – Dremor
            Mar 25 at 14:33











          • You're welcome @Dremor. I found out more and updated the answer.

            – Aron
            Mar 25 at 18:06
















          2














          Here's one way to find the Contact to Address relationship:



          https://myOrg.api.crm.dynamics.com/api/data/v9.1/EntityDefinitions(LogicalName='customeraddress')?$select=LogicalName&$expand=ManyToOneRelationships($select=ReferencingAttribute,ReferencedEntity)



          AddressRelationship



          I got an error with https://myOrg.api.crm.dynamics.com/api/data/v9.1/contacts(guid)?$expand=address1_addressid.



          I looked into the MetaData and discovered that address1_addressid has a type of Primary Key:
          PrimaryKey



          While a normal lookup field has a type of Lookup:
          Lookup



          Considering the error message that appears when attempting to expand address1_addressid, I think the issue is address1_addressid's data type.




          Property 'address1_addressid' on type 'Microsoft.Dynamics.CRM.contact'
          is not a navigation property or complex property. Only navigation
          properties can be expanded.




          It would seem that rather than using $expand to get the address details, you'd have to make a separate call for it:
          https://myOrg.api.crm.dynamics.com/api/data/v9.1/customeraddresses(guid)



          UPDATE

          By reviewing the full Contact-Address relationship, via this query: https://myOrg.api.crm.dynamics.com/api/data/v9.1/EntityDefinitions(LogicalName='customeraddress')?$select=LogicalName&$expand=ManyToOneRelationships.



          I discovered the ReferencedEntityNavigationPropertyName was set to Contact_CustomerAddress.



          fullRelationship



          The error message before talked about the Navigation property so I gave it a shot. Using that property named allowed me to expand the Address info from the Contact:



          https://myOrg.api.crm.dynamics.com/api/data/v9.1/contacts(guid)?$expand=Contact_CustomerAddress



          Interestingly, expanding that navigation property returns all 3 customer addresses:
          Addresses






          share|improve this answer

























          • Thank (again ;) ) Aron, will try this as soon as I've time.

            – Dremor
            Mar 25 at 14:33











          • You're welcome @Dremor. I found out more and updated the answer.

            – Aron
            Mar 25 at 18:06














          2












          2








          2







          Here's one way to find the Contact to Address relationship:



          https://myOrg.api.crm.dynamics.com/api/data/v9.1/EntityDefinitions(LogicalName='customeraddress')?$select=LogicalName&$expand=ManyToOneRelationships($select=ReferencingAttribute,ReferencedEntity)



          AddressRelationship



          I got an error with https://myOrg.api.crm.dynamics.com/api/data/v9.1/contacts(guid)?$expand=address1_addressid.



          I looked into the MetaData and discovered that address1_addressid has a type of Primary Key:
          PrimaryKey



          While a normal lookup field has a type of Lookup:
          Lookup



          Considering the error message that appears when attempting to expand address1_addressid, I think the issue is address1_addressid's data type.




          Property 'address1_addressid' on type 'Microsoft.Dynamics.CRM.contact'
          is not a navigation property or complex property. Only navigation
          properties can be expanded.




          It would seem that rather than using $expand to get the address details, you'd have to make a separate call for it:
          https://myOrg.api.crm.dynamics.com/api/data/v9.1/customeraddresses(guid)



          UPDATE

          By reviewing the full Contact-Address relationship, via this query: https://myOrg.api.crm.dynamics.com/api/data/v9.1/EntityDefinitions(LogicalName='customeraddress')?$select=LogicalName&$expand=ManyToOneRelationships.



          I discovered the ReferencedEntityNavigationPropertyName was set to Contact_CustomerAddress.



          fullRelationship



          The error message before talked about the Navigation property so I gave it a shot. Using that property named allowed me to expand the Address info from the Contact:



          https://myOrg.api.crm.dynamics.com/api/data/v9.1/contacts(guid)?$expand=Contact_CustomerAddress



          Interestingly, expanding that navigation property returns all 3 customer addresses:
          Addresses






          share|improve this answer















          Here's one way to find the Contact to Address relationship:



          https://myOrg.api.crm.dynamics.com/api/data/v9.1/EntityDefinitions(LogicalName='customeraddress')?$select=LogicalName&$expand=ManyToOneRelationships($select=ReferencingAttribute,ReferencedEntity)



          AddressRelationship



          I got an error with https://myOrg.api.crm.dynamics.com/api/data/v9.1/contacts(guid)?$expand=address1_addressid.



          I looked into the MetaData and discovered that address1_addressid has a type of Primary Key:
          PrimaryKey



          While a normal lookup field has a type of Lookup:
          Lookup



          Considering the error message that appears when attempting to expand address1_addressid, I think the issue is address1_addressid's data type.




          Property 'address1_addressid' on type 'Microsoft.Dynamics.CRM.contact'
          is not a navigation property or complex property. Only navigation
          properties can be expanded.




          It would seem that rather than using $expand to get the address details, you'd have to make a separate call for it:
          https://myOrg.api.crm.dynamics.com/api/data/v9.1/customeraddresses(guid)



          UPDATE

          By reviewing the full Contact-Address relationship, via this query: https://myOrg.api.crm.dynamics.com/api/data/v9.1/EntityDefinitions(LogicalName='customeraddress')?$select=LogicalName&$expand=ManyToOneRelationships.



          I discovered the ReferencedEntityNavigationPropertyName was set to Contact_CustomerAddress.



          fullRelationship



          The error message before talked about the Navigation property so I gave it a shot. Using that property named allowed me to expand the Address info from the Contact:



          https://myOrg.api.crm.dynamics.com/api/data/v9.1/contacts(guid)?$expand=Contact_CustomerAddress



          Interestingly, expanding that navigation property returns all 3 customer addresses:
          Addresses







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 25 at 18:06

























          answered Mar 25 at 14:17









          AronAron

          2,6483 gold badges10 silver badges19 bronze badges




          2,6483 gold badges10 silver badges19 bronze badges












          • Thank (again ;) ) Aron, will try this as soon as I've time.

            – Dremor
            Mar 25 at 14:33











          • You're welcome @Dremor. I found out more and updated the answer.

            – Aron
            Mar 25 at 18:06


















          • Thank (again ;) ) Aron, will try this as soon as I've time.

            – Dremor
            Mar 25 at 14:33











          • You're welcome @Dremor. I found out more and updated the answer.

            – Aron
            Mar 25 at 18:06

















          Thank (again ;) ) Aron, will try this as soon as I've time.

          – Dremor
          Mar 25 at 14:33





          Thank (again ;) ) Aron, will try this as soon as I've time.

          – Dremor
          Mar 25 at 14:33













          You're welcome @Dremor. I found out more and updated the answer.

          – Aron
          Mar 25 at 18:06






          You're welcome @Dremor. I found out more and updated the answer.

          – Aron
          Mar 25 at 18:06









          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55338836%2fhow-to-retrieve-addresses-using-the-odata-endpoint%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript