0

I have a custom connector wrote in c# which exposes a table from sql server and we have used the endpoint to External Data Source. We are able to query the data and see it in Salesforce but when we try to update the values we are getting the below error

Unfortunately, an error occurred when accessing the data. Error message: []: No HTTP resource was found that matches the request URI 'https://XXXXXXXXX.azurewebsites.net/Products(1)' .

The wierd thing is in Developer console if i do a PATCH http request , its working fine and returning 204 success and the same is happening from POSTMAN also .

But if i am trying to update it using below i am getting the same error

Persons__x mm = new Persons__x();
mm.Id = 'x0AQI000002eHrs2AE';
mm.FirstName__c = 'mmmm';
try{
  Database.SaveResult sr = Database.updateAsync (mm);  
    if (! sr.isSuccess ()) {
        String locator =  Database.getAsyncLocator ( sr ); 
        
        for( Database.Error vv : sr.getErrors()) {
          system.debug( vv);  
        }
    }
}catch(exception e){
    system.debug('@@@@' + e);
}

Here is my metadata in external system and there is PRIMARY KEY in the table

<?xml version="1.0" encoding="UTF-8"?><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="ProductService.Models">
      <EntityType Name="Persons">
        <Key>
          <PropertyRef Name="PersonId"/>
        </Key>
        <Property Name="LastName" Type="Edm.String"/>
        <Property Name="FirstName" Type="Edm.String"/>
        <Property Name="Pid" Type="Edm.String"/>
        <Property Name="Address" Type="Edm.String"/>
        <Property Name="City" Type="Edm.String"/>
        <Property Name="Country" Type="Edm.String"/>
        <Property Name="PostCode" Type="Edm.String"/>
        <Property Name="Job" Type="Edm.String"/>
        <Property Name="Mobile" Type="Edm.String"/>
        <Property Name="Phone" Type="Edm.String"/>
        <Property Name="Fax" Type="Edm.String"/>
        <Property Name="Street" Type="Edm.String"/>
        <Property Name="Hobbies" Type="Edm.String"/>
        <Property Name="Game" Type="Edm.String"/>
        <Property Name="PersonId" Nullable="false" Type="Edm.Int32"/>
      </EntityType>
    </Schema>
    <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="Default">
      <EntityContainer Name="Container">
        <EntitySet EntityType="ProductService.Models.Persons" Name="Products"/>
      </EntityContainer>
    </Schema>
  </edmx:DataServices>
</edmx:Edmx>

What might be possibly wrong .

0

You must log in to answer this question.

Browse other questions tagged .