Solved

[REST API] - Purchase Order Action - Open/Hold

  • 19 March 2024
  • 6 replies
  • 77 views

Userlevel 3
Badge

Hello Developers,

I hope everything is going well.

I'm currently working on implementing a feature to "Hold" a Purchase Order using the Rest API. I've set up the necessary actions in our web services.

Here's the rundown:

  1. Actions - WebServices

  2. This is the Purchase Order I'm attempting to put on "HOLD."

Actions - WebServices

2- 

 

This is Purchase Order I”m trying to “HOLD”

 

 

 

I've sent the request using the following endpoint: https://company.acumatica.com/entity/vendorpolineitems/22.200.001/PurchaseOrder/Hold

 

4- Request Body 

 

{
    "entity": {
        "Type": {
            "value": "Normal"
        },
        "OrderNbr": {
            "value": "PPO05340"
        }
    }
}

 

 

Unfortunately, I encountered the following error:

 

 

"source": "application", "code": 500, "message": "{\"message\":\"An error has occurred.\",\"exceptionMessage\":\"Operation failed\",\"exceptionType\":\"PX.Data.PXInvalidOperationException\",\"stackTrace\":\" at PX.Api.ContractBased.EntityService.Invoke(ISystemContract systemContract, String version, String name, EntityImpl entity, ActionImpl action, CbOperationContext operationContext, Boolean throwOnError)\\r\\n at PX.Api.ContractBased.Soap.SoapFacadeBase.InvokeImpl(EntityImpl entity, ActionImpl action, Boolean throwOnError)\\r\\n at PX.Api.ContractBased.SystemContracts.V4.Facade.PX.Api.ContractBased.IRestGate.Invoke(EntityImpl entity, ActionImpl action, String objectName,

 

 

Thanks

icon

Best answer by Driss 20 March 2024, 14:26

View original

6 replies

Userlevel 3
Badge

@jinin @RohitRattan88 The Issue is fixed the action on the new version 22.200.001 is not working i tested 20.200.001 and that worked, Thank you all for your help , much appreciated

Userlevel 3
Badge

@jinin Thank you, yes now i got different error which is good

 

{"message":"An error has occurred.","exceptionMessage":"More than one entity satisfies the condition.

Userlevel 7
Badge +11

Hi @Driss ,

I suspect there may be an issue with the orderNbr field value. The screen displays PPO-05340, while the endpoint shows PPO05340. Please confirm this and also verify the segment key separator.

If we include separators, then we need to include all segments as well.

e.g.

            "InventoryID": {

                "value": "01-029-0100-   "  // note 3 spaces for the 4th segment

            },

 

 


 

Userlevel 3
Badge

@jinin @RohitRattan88 Thanks all for the reply 

Yes i tried the PutOnHold Action and got same error

this is my request 

{
  "entity": {
    "Type": {
      "value": "Normal"
    },
    "OrderNbr": {
      "value": "PPO05340"
    }
  }
}

Userlevel 7
Badge +11

Hi @Driss ,

As @RohitRattan88  suggested, consider using the PutOnHold Action. The Hold action will not be supported.


 

 

Userlevel 7
Badge +4

@Driss 

Action “Hold” is actually names “PutOnHold”

Maybe try using PutOnHold in your call

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