Skip to main content
Solved

$select after API action returns empty body

  • March 12, 2025
  • 3 replies
  • 67 views

Forum|alt.badge.img

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.

3 replies

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

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


Forum|alt.badge.img
  • Author
  • Freshman II
  • 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
  • March 13, 2025

@sclassing correct