Skip to main content
hello I want to ask, previously I could use the api purchase order on 2020R1 but for the use of api cancel purchase orders on acum2021R2 I couldn't, is there a reference I can check?
Error Cancel Order
Success Cancel Order but in screen not cancelled​​​​​

 


Hi @abdi  I just worked on it in 21 R2 version and I can able to Cancel the Purchase Order successfully.

Here is the screenshot for your reference. Hope this helps!

Let me know if you face any issues.

 

 

 


hi @Naveen B still not working :frowning2:
 

 


Hi @abdi  There is definitely something wrong with your instance.

Are you able to do this operation manually from the Purchase Orders screen?


Hi @Naveen B , if on the PO screen the cancel process everything goes normally


@abdi  Do you have any customizations published, if yes, can you please unpublish and verify once.

 


Hi @Naveen B  I've tried to unpublish and retest the api, the result still returns 500

 

 


Hi @abdi  In below 2 cases we will get the 500 error.

  • Wrong JSON body format
  • Wrong Endpoint URL

In your case, JSON body looks good, can you please review twice whether the URL is correct or not?

Also, as a response you are getting Object Reference error, it might be due to the some other customization causing this issue.

Please verify in new 21 R2 instance and check. I have verified this REST API in brand new instance, NO Errors Occurred.


hi @Naveen B , i have update.
for the cancel po function, it can be used after restarting the application but only for the normal type, when canceling the po for the drop ship type, canceling the po will be an error and canceling the normal type po is also an error.
then need to restart the application again and cancel po type normal can ne used again.

 

I don't know why the drop ship type makes an api error, and what I need is to cancel the drop ship type

 

normal type

 

Drop Ship Type

 


Hi  @Naveen B i have new update.
Problem Solved, i can cancel po with Dropship type, there is an error message after restarting the application.

The problem is in the PO linked to SO.
so the way is to cancel the SO then cancel the connected PO

thanks for helping me

 

regrads


@abdi  You need to invoke the 2 REST API calls, to first cancel the Sales Order and then Purchase Order.


Reply