Skip to main content
Solved

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

  • March 19, 2024
  • 6 replies
  • 217 views

Driss
Jr Varsity III
Forum|alt.badge.img
  • Jr Varsity III
  • 29 replies

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

Best answer by Driss

@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

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

6 replies

RohitRattan88
Acumatica Moderator
Forum|alt.badge.img+4
  • Acumatica Moderator
  • 252 replies
  • March 19, 2024

@Driss 

Action “Hold” is actually names “PutOnHold”

Maybe try using PutOnHold in your call


jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • 693 replies
  • March 19, 2024

Hi @Driss ,

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


 

 


Driss
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 29 replies
  • March 19, 2024

@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"
    }
  }
}


jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • 693 replies
  • March 20, 2024

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

            },

 

 


 


Driss
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 29 replies
  • March 20, 2024

@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.


Driss
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 29 replies
  • Answer
  • March 20, 2024

@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


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