Solved

REST API to Update Attributes

  • 10 November 2023
  • 3 replies
  • 134 views

Userlevel 2
Badge

I’m trying to update an attribute value on appointments in Postman but the value will not update.

Here is my PUT request:{{acuBaseUrl}}/Appointment?$filter=ServiceOrderType eq 'PM' and AppointmentNbr eq 'SV001280-1'&$expand=Attributes&$select=AppointmentNbr,Attributes/Attribute,Attributes/Value

Here is the body:

{

    "ServiceOrderType": { "value": "PM" },

    "AppointmentNbr": { "value": "SV001280-1" },

    "Attributes": 

    [

        {

            "AttributeID": {"value": "Is Inspection Complete?"},

            "Value": {"value": true}

        }

    ]

}

I’m not sure what else needs to be done.  I’ve also tried using the Attribute ID of INSPECTED but it still won’t update.  I’m using the Default/22.200.001 endpoint.

icon

Best answer by jinin 10 November 2023, 19:12

View original

3 replies

Userlevel 7
Badge +11

Hi @vpoulson 

You should use Attribute instead of AttributeID.  Could you please change and check?

{

    "ServiceOrderType": { "value": "PM" },

    "AppointmentNbr": { "value": "SV001280-1" },

    "Attributes": 

    [

        {

            "Attribute": {"value": "Is Inspection Complete?"},

            "Value": {"value": true}

        }

    ]

}

As per the default endpoint, it should be Attribute.
 

 

Userlevel 7
Badge +4

@vpoulson  as @jinin suggested use the correct endpoint.

A related discussion on the issue:

Attributes not updated in PUT Request(creation of record) | Community (acumatica.com)

Also, dont use $filter or other parameters in the PUT call

{{acuBaseUrl}}/Appointment?$filter=ServiceOrderType eq 'PM' and AppointmentNbr eq 'SV001280-1'&$expand=Attributes&$select=AppointmentNbr,Attributes/Attribute,Attributes/Value

 

Instead make call to base entity with key fields in the bosy:

URL: {{acuBaseUrl}}/Appointment

body:

{

    "ServiceOrderType": { "value": "PM" },

    "AppointmentNbr": { "value": "SV001280-1" },

    "Attributes": 

    [

        {

            "Attribute": {"value": "Is Inspection Complete?"},

            "Value": {"value": true}

        }

    ]

}

Userlevel 2
Badge

@RohitRattan88 thank you so much.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved