Skip to main content
Solved

Delete attribute value via REST API

  • June 9, 2025
  • 5 replies
  • 114 views

I’m trying to delete a value from an attribute.  I’m trying by sending the attribute with the value needing to be deleted with the “delete” flag set to true.  I’m getting back no error message at all, with a status of OK, but the value is not being deleted.

I can manually delete the value via the GUI, but the REST API will not delete it.

The JSON object being sent to the AttributeDefinition endpoint:

{"AttributeID":{"value":"DKWHLWIDTH"},"Values":[{"ValueID":{"value":"3-3/4"},"delete":true}]}

Any suggestions?

Best answer by Django

In my notes for deleting detail lines off of sales orders, I’m using the id value from the detail line to tell ACM what record to delete. And a PUT call do to the delete.

So I first use a GET to determine which record I want to remove and then in the subsequent call, I pass the id field:

{

    "OrderType":{"value":"SO"},   

    "OrderNbr":{"value":"000041"},

    "Details":[

    {

        "id""e65bb9a6-3209-ed11-82c7-123012649d33",

        "delete"true

    }

    ,{

        "id""e65bb9a6-3209-ed11-82c7-45252f34552a",

        "delete"true

    }

    ]

}

So, in your case, don’t pass ValueID in the values, pass the id of the Value record instead. See if that works.

5 replies

Forum|alt.badge.img+7
  • Captain II
  • June 9, 2025

Are you sending a DELETE request? What’s the URL you’re using?


  • Author
  • Freshman I
  • June 9, 2025

I’m sending a PUT request.  If I send a DELETE request, I get an “Object reference not set to an instance of an object.” exception.

 

The URL is https://MyTenant/entity/MyCustomEndpoint/1.100.001/AttributeDefinition


  • Author
  • Freshman I
  • June 11, 2025

No suggestions on this issue?


Forum|alt.badge.img+7
  • Captain II
  • Answer
  • June 11, 2025

In my notes for deleting detail lines off of sales orders, I’m using the id value from the detail line to tell ACM what record to delete. And a PUT call do to the delete.

So I first use a GET to determine which record I want to remove and then in the subsequent call, I pass the id field:

{

    "OrderType":{"value":"SO"},   

    "OrderNbr":{"value":"000041"},

    "Details":[

    {

        "id""e65bb9a6-3209-ed11-82c7-123012649d33",

        "delete"true

    }

    ,{

        "id""e65bb9a6-3209-ed11-82c7-45252f34552a",

        "delete"true

    }

    ]

}

So, in your case, don’t pass ValueID in the values, pass the id of the Value record instead. See if that works.


  • Author
  • Freshman I
  • June 11, 2025

That got it.  Thanks!