Skip to main content
Answer

REST API: how do I DELETE a Sales Price row (AR202000 screen) using InventoryID, PriceType, and PriceCode?

  • July 5, 2024
  • 3 replies
  • 82 views

Forum|alt.badge.img+2

I can delete a row fine if I use RecordId.  However, in the case I don’t have the exact RecordId, how do I delete a row using these values:

{

    "SalesPriceDetails": [

        {

            "InventoryID": { "value": "00000-00002" },

            "PriceType": { "value": "Customer Price Class" },

            "PriceCode": { "value": "VIP" },

            "delete": true

        }

    ]

}

 

When I try this, it deletes the first InventoryID/PriceType it finds which will delete the wrong row if I have a row with a PriceCode like “WHOLESALE”.

Best answer by dcomerford

You could use 2 rest calls the first is to get the RecordId with the values you have then use the result to delete it.

I think you need the recordid to delete.

3 replies

dcomerford
Captain II
Forum|alt.badge.img+15
  • Captain II
  • Answer
  • July 5, 2024

You could use 2 rest calls the first is to get the RecordId with the values you have then use the result to delete it.

I think you need the recordid to delete.


Forum|alt.badge.img+2
  • Author
  • Semi-Pro I
  • July 5, 2024

You could use 2 rest calls the first is to get the RecordId with the values you have then use the result to delete it.

I think you need the recordid to delete.

Is there a way to get the RecordID without having parse through the entire SalesPricesInquiry object including all the child SalesPriceDetails objects?  Here’s what I’m using currently:

https://sandbox.com/AcumaticaERP/entity/Default/20.200.001/SalesPricesInquiry?$expand=SalesPriceDetails

body:

{

    "InventoryID": {"value": "00000-00002"},

    "PriceType": {"value": "Customer Price Class"},

    "PriceCode": { "value": "VIP" }

}


dcomerford
Captain II
Forum|alt.badge.img+15
  • Captain II
  • July 7, 2024

@bpgraves I dont believe so.