Skip to main content
Solved

$select after API action returns empty body


We have defined an action on SOShipment and exposed it via the REST API.  When we call the action for the API we define a query string param $select=ShipmentNbr.  The action succeeds, but the the return body is empty.  We expected to see an SOShipment, with the ShipmentNbr specified.  How can we fix this?

Here are the details

 

On SOShipmentEntryExt, we define an action named AddShipmentNbr.

        public PXAction<SOShipment> AddShipmentNbr;
        [PXUIField(DisplayName = "Add ShipmentNbr",
            MapEnableRights = PXCacheRights.Select,
            MapViewRights = PXCacheRights.Select)]
        [PXButton()]
        public virtual IEnumerable addShipmentNbr(PXAdapter adapter)
        {
            ...
        }

We exposed this action as an Action on the Shipment REST API, naming it LockShipmentMutex.

 

We construct a call in Postman

POST {{PackingEndpointURL}}/Shipment/LockShipmentMutex?$select=ShipmentNbr

BODY

{
    "entity": {
        "id": "6B4E9A21-78F6-EA11-96A4-000D3A610F1B"
    }
}

The action succeeds, but we receive an empty body in the response.  We expected to receive a SOShipment entity with ShipmentNbr field specified.

Best answer by Dmitrii Naumov

Action execution only returns the status code. Returning a body from Action is not supported.

View original
Did this topic help you find an answer to your question?

3 replies

Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • 645 replies
  • Answer
  • March 13, 2025

Action execution only returns the status code. Returning a body from Action is not supported.


  • Author
  • Freshman I
  • 7 replies
  • March 13, 2025

@Dmitrii Naumov So there’s no way to return a value from an action (other than the HTTP status code)?


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • 645 replies
  • March 13, 2025

@sclassing correct


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