function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DahveedDahveed 

External object and OData 4.0 connector

I'm connecting to a .Net framework via OData 4.0 connector.The connection has been created and sync'd successfully showing all fields that are in the metadata. However when I navigate to the external object or try to SOQL query it I get 
External Object Error
Could not deserialize feed: 

It seems salesforce is expecting the data in a way that the oData connector is not sending. I have access to the oData connector. How should the data be getting sent?
What is the best way to troublshoot this?
pconpcon
This is likely an issue with how the OData is being generated and returned to Salesforce.  What library are you using to generate your OData connection in .Net?  Do you have a development instance with non-production data that is publicly available?
DahveedDahveed
Sorry for the delay our .Net was away for the holidays.  We are using System.Web.OData Library. Unfortunately he wasn't comfortable giving out the url however here are some screen shots.
{
  "@odata.context":"https://xxxxxxxxxxxxxx.com/test/$metadata","value":[
    {
      "name":"Products","kind":"EntitySet","url":"Products"
    }
  ]
}
 
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<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="XXXXXXXXXX.Net.Data.DataManagement.DataSystem.OData">
<EntityType Name="Products">
<Key>
<PropertyRef Name="ProductID"/>
</Key>
<Property Name="ProductID" Type="Edm.Int64" Nullable="false"/>
<Property Name="PLU" Type="Edm.Int64" Nullable="false"/>
<Property Name="Name" Type="Edm.String" Nullable="false"/>
<Property Name="StockOnHand" Type="Edm.Decimal" Nullable="false"/>
</EntityType>
</Schema>
<Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="Default">
<EntityContainer Name="Container">
<EntitySet Name="Products" EntityType="XXXXXXXXXXXX.Net.Data.DataManagement.DataSystem.OData.Products"/>
</EntityContainer>
</Schema>
</edmx:DataServices>
</edmx:Edmx>
Juan Pinedo 4Juan Pinedo 4
Hi all,
This is happening too me in my org. My schema seems to be right, if I access via URL through browser i can retrieve correctly the data. But when doing with salesforce list views, the error is shown again...
Any information about the odata interface JSON format??
DahveedDahveed
Ok so embarrassing detail. I was looking through my External Data Source and realize somehow the Format got set to AtomicPub instead of JSON. Seemed to be good after that.
Juan Pinedo 4Juan Pinedo 4
I solved it too, in my case it was related to the certificate inte configuration of lightning connect. It seems the certificate also can break the serialization if it is not correctly configured.
Just for your information. Thanks all!
Robert BlackketterRobert Blackketter
Juan Pinedo, I am receiving the the same error due to certificates.  You mentioned it has be configured correctly, where did you find the solution?
 
SergeiSergei
If you need a no-coding solution, take a look at this Salesforce OData connector (https://skyvia.com/connect/salesforce-odata). You will be able to expose live Salesforce data via OData protocol and get additional features, including advanced built-in security and detailed logging.