Resource not found for the segment

I've create an API Page called APISP3 in a VSCode AL Extension. The SourceTable is "Sales Price". I've deployed to Business Central and I've added a web service for the aforementioned API Page. I've downloaded the metadata. Now I'm trying to perform CRUD operations in a C# program via an Unchase OData Connected service. I'm reading records OK. I can add a new record OK, but when I try to perform an update I'm getting: "Resource not found for the segment 'APISP3'" when I call context.SaveChanges. The relevant part of my code is below. Any help would be greatly appreciated.
decimal newValue = 65;
Gulf.NAV.APISP3 gobjRecToUpdate = null;
var qryAllSPs = from lobjSP in objContext.APISP3 select lobjSP;
DataServiceCollection<Gulf.NAV.APISP3> colAllSPs = new DataServiceCollection<Gulf.NAV.APISP3>(qryAllSPs, TrackingMode.None);
foreach (Gulf.NAV.APISP3 item in colAllSPs)
{
    gobjRecToUpdate = item;
    break;
}
gobjRecToUpdate.UnitPrice = newValue;
foreach (var entry in objContext.EntityTracker.Entities)
{
    objContext.Detach(entry.Entity);
}
objContext.AttachTo("APISP3", gobjRecToUpdate, "*");
objContext.UpdateObject(gobjRecToUpdate);
objContext.SaveChanges(SaveChangesOptions.None); // <--- Resource not found for the segment 'APISP3'
Related
Recommended