1

Attempting to set up an OData external data source to Dynamics Great Plains - confirmed I can connect via OData using MS Excel, so I believe that's right. When attempting to set this up in Salesforce as an external data source, validate-and-sync gives back this error when using OData 2.0:

This data isn't available because the associated table in the external data source can't be found. Contact your administrator for help. Attempted query URL: https://my.endpoint.com/GPOData/GP2SF/$metadata

And when using OData 4.0, the error is a bit different:

Can't sync the schema metadata for your external system. Check that the schema metadata is valid. Error code: null

The endpoint URL I've configured is this: https://my.endpoint.com/GPOData/GP2SF/. Fetching that document via a browser returns:

{
  "@odata.context":"https://my.endpoint.com/GPOData/GP2SF/$metadata","value":[
    {
      "name":"Test","kind":"EntitySet","url":"Test"
    }
  ]
}

And following that $metadata URL, which is the URL SF references in its first error, gives this:

<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
<edmx:DataServices>
<Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="Microsoft.Dynamics.GP.OData.Provider.Generated.GP2SF.Models">
<EntityType Name="SFTest">
<Property Name="BillAccount" Type="Edm.String" Nullable="false"/>
</EntityType>
<EntityContainer Name="Container">
<EntitySet Name="Test" EntityType="Microsoft.Dynamics.GP.OData.Provider.Generated.GP2SF.Models.SFTest"/>
</EntityContainer>
</Schema>
</edmx:DataServices>
</edmx:Edmx>

Aside from an odd transition from JSON to XML, this seems correct.

Anyone have any ideas on what's wrong?

1 Answer 1

0

Heard back from Salesforce on what's wrong - the object I'm attempting to sync lacks a primary key. Once you have a PK defined, the $metadata response will have a section like this in it:

<Key>
<PropertyRef Name="MyPKField"/>
</Key>

And once that's there, the object validates-and-sync's fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.