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
Richard CookRichard Cook 

Lightning Connect - Can't delete external object in dev org

I have two dev orgs set up and have been experimenting with Lightning Connect in them. Recently in one of my dev orgs I cannot delete the external object associated with the external data source. I can still do so in the other. When I try to delete the external object I get the message "Insufficient Privileges - You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary." It's a dev org; I am the administrator. Any suggestions on who to contact or troubleshoot would be appreciated.
pconpcon
I have seen this occur when the system thinks the object doesn't exist anymore, but obviously it does in your case.  Have you tried removing it via the MetadataAPI instead of via the UI?  You could do it pretty quickly with JSForce [1]

[1] https://jsforce.github.io/document/#delete-metadata
RishavRishav
Hii Richard,
                    'Erase" is working fine for deleting the external object. 

Thanks
Rishav
Richard CookRichard Cook
pcon, using the metadata API didn't help. I used jsforce to make a node.js app and successfully used it to delete an "ordinary" CustomObject from my org, but using the same code to delete my external object didn't work. The node app didn't console.log out any errors. Copypasting the code from the jsforce delete example, results.length is undefined for both runs of the node app.
pconpcon
That's really weird.  If it was a production instance I would tell you to file a case, but since it's dev sandbox, I would just chalk it up to gremlins and spin up a new dev sandbox.
Valeriy KutsarValeriy Kutsar
I had this problem too. I solved it by pulling that data in through vscode using the salesforce cli extension. Then I ran the delete command on it and I was able to delete the object.