0

I don't see any examples in the Acumatica help or in the training on how to actually remove / delete a record from a custom screen / table using the REST (Contract-based) API. How would one go about doing this? Is it a PUT with different syntax? I did see a Stack Overflow case on deleting detail records - I tried this method and it didn't work for me.

Acumatica REST API - Delete SalesOrderDetail

That also refers to a header/detail setup, which I don't have (only grid details). Any help would be appreciated. Thanks...

pmfith
  • 831
  • 6
  • 24

1 Answers1

0

You can simply send a DELETE request with the id or the key of your record. That will result in the deletion of the specified record.

curl --location --request DELETE 'https://ACUMATICA_URL/entity/Default/20.200.001/ShippingBox/d9ec53fa-b454-4cf0-b398-817b3b1a84aa'

curl --location --request DELETE 
'http://<Base endpoint URL>/entity/Default/20.200.001/ShippingBox/TEST'

You can find more information at the following links:

Remove a Record by Key Fields

Remove a Record by ID

Samvel Petrosov
  • 7,580
  • 2
  • 22
  • 46
  • I continually get this error: "No entity satisfies the condition." I know the key field values are correct. – pmfith Nov 29 '22 at 16:22
  • @pmfith have you tried to send the request using the id instead of the key fields? Does it work that way? You have already extended the endpoint, correct? – Samvel Petrosov Nov 29 '22 at 18:32
  • yeah - I figured it out that I can retrieve by key fields to get the id, then delete using the id. Still can't delete just using the keyfields, but oh well... Thanks Samvel ;D – pmfith Nov 29 '22 at 22:30
  • @pmfith that's strange that your keys work for the get request but fail for the delete request. Are you using the same format there? :D – Samvel Petrosov Nov 29 '22 at 22:51