Skip to main content
Solved

Delete Budget Line via REST Deletes matching Accounts ignoring Subaccount


BrettBaldwin
Freshman I

I have Budget with line items as follows (simplified):

{
  "account": "4100000",
  "subaccount": "ADMIN"
  "amount": 123.45
}, 
{
  "account": "4100000",
  "subaccount": "CAPWRK"
  "amount": 567.89
}, 
{
  "account": "5555555",
  "subaccount": "ADMIN"
  "amount": 1000.00
}

 

If I `PUT` to `/entity/Default/20.200.001/Budget`  but mark `”Delete”: true` on only the first item, both the first two items are deleted - ie: both items with 4100000 as the `account` are deleted, not just the ADMIN subaccount line item.

Am I missing something obvious??

Best answer by Samuel Olivier Lavigueur

Normally if you want to delete detail line from a record using the API, it is recommended that you first retrieve the record and then use the “id” value along with the delete in order to delete that line

{
  “Budget Key Fieldsor 
  "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
}, 
  ”Details: [
  {
    "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "delete": true
  }
]
View original
Did this topic help you find an answer to your question?

4 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3381 replies
  • March 23, 2022

Hi @BrettBaldwin  I’m assuming that this issue is with the KEY fields. 

From the GLBudgetLine DAC, below are KEY fields and you can try with below fields and verify.

  • BranchID
  • LedgerID 
  • GroupID
  • ParentGroupID
  • FinYear

 

 


Samuel Olivier Lavigueur
Acumatica Moderator
Forum|alt.badge.img+2

Normally if you want to delete detail line from a record using the API, it is recommended that you first retrieve the record and then use the “id” value along with the delete in order to delete that line

{
  “Budget Key Fieldsor 
  "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
}, 
  ”Details: [
  {
    "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "delete": true
  }
]

BrettBaldwin
Freshman I
  • Author
  • Freshman I
  • 2 replies
  • March 23, 2022

Thanks for the quick replies @SLavigueur and @Naveen Boga - much appreciated!!!

My process is to retrieve the Budget (via “empty” PUT), then update the changes to the detail lines (eg: `amount` / `delete`) as appropriate. I thought that this would leave the `id` fields intact as well as the other key fields setup to allow the back end to match the records to action but am still seeing this weirdness on delete…

Confirming I can “mix” adding / updating / deleting detail lines in the same PUT call???


Samuel Olivier Lavigueur
Acumatica Moderator
Forum|alt.badge.img+2

As long as you are specifying the proper “id” value for the update and the delete and no “id” for the adding (since there isn’t one yet), then yes you should be able to do adding / updating / deleting in the same PUT call.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings