cancel
Showing results for 
Search instead for 
Did you mean: 
My Areas

Sign in or create account

to get a personalized navigation.

mrtnsn
CONTRIBUTOR ***

reopenSalesOrder: Document not found

by mrtnsn (Updated ‎02-12-2020 13:27 by Yildirim VISMA )

Trying to open a "Cancelled" order. Using the GUI to trigger "reopen" works.

 

Endpoint:

POST /controller/api/v1/salesorder/000001/action/reopenSalesOrder

 

JSON:

 

 

{
  "saleOrderUpdateDto": {
    "orderType": {
      "value": "SO"
    }
  }
}

 

 

 

Response:

{"message":"No document data found"}

 

Expected:

ReopenSalesOrderActionResultDto object containing actionId, actionResult and errorInfo.

 

Screenshot 2020-09-24 at 11.00.31.png

GUI, I'm expecting "reopen" to be number 2. And number 1 to be a normal update with changing the status to open. If not, that explains the issue I'm having right now.

6 REPLIES 6
Yildirim
VISMA

by Yildirim

Hello, we're currently investigating this. We'll get back to you shortly.

Yildirim
VISMA

by Yildirim (Updated ‎23-05-2021 14:39 by Yildirim VISMA )

/action/reopenSalesOrder sub-endpoint is following the same behaviour that can be observed in the Financials UI.

1-Once you click Re-Open action on the Completed Sales Order 

1.png

2- SO Status becomes Back-Order, and it expects user to update desired fields. (Except Lines)
2.png


3-Once desired fields have been adjusted then user can save the document. (SO Status becomes Completed again)

If you try to save the document without making any adjustments right after initiating Re-Open Action, SO will go back to its initial status. 

Consequently, you should at least send a field that contains an updated value when invoking the API Call.

E.g

 

POST: https://integration.visma.net/API/controller/api/v1/salesorder/000339/action/reopenSalesOrder

 

 

 

{
	"saleOrderUpdateDto": {
		"orderType": {
			"value": "SO"
		},
		"description": {
			"value": "TEST Re-open"
		}
	}
}

 

mrtnsn
CONTRIBUTOR ***

by mrtnsn

But it doesn't follow the same behaviour as GUI, unless I'm misunderstanding what it does in the GUI.

 

In the GUI, I can click the "Reopen order" button and it will change status from "Cancelled" to "Open" and be saved, without any changes done to any other field (that I can see).

 

When running the code as provided earlier the document is "not found".

 

Also, if I try your example by adding a field to change (description in this test) I get the following error.

{"message":"Order can't be reopened because it is not completed"}

 

But as mentioned earlier this is working without changing any fields in the GUI. 

Yildirim
VISMA

by Yildirim (Updated ‎24-09-2020 13:31 by Yildirim VISMA )

The scenario we've shared above was SO: Complete > Re-Open.

After testing the SO: Cancelled > Re-Open scenario we confirm that your inference is true and API wrongfully returns the mentioned error message.

In aforementioned both cases, 
-API should not require any additional field in the POST request to realize Re-Open action

{
"saleOrderUpdateDto": {
"orderType": {
"value": "ORDERTYPE"
}
}


-API should not return the following error message for the SO: "Cancelled" when Re-Open Action invoked.

"message": "Order can't be reopened because it is not completed"


This has been registered as a bug, and we'll check this with our team. We'll provide updates as they come in.

mrtnsn
CONTRIBUTOR ***

by mrtnsn

Thank you for the update.

 

-API should not require any additional field in the POST request to realize Re-Open action

Based on the documentation "This method requires a sales order update dto where the order type is initialised.", so that will still be true I guess. Or if it will be changed to use the same DTO schema as CancelSalesOrderActionDto only requiring "orderType" to be set.

Accepted solution
Yildirim
VISMA

by Yildirim (Updated ‎10-11-2020 11:33 by Yildirim VISMA )

Thank you too for bringing this issue to our attention. 

 


@mrtnsn wrote:

Based on the documentation "This method requires a sales order update dto where the order type is initialised.", so that will still be true I guess. Or if it will be changed to use the same DTO schema as CancelSalesOrderActionDto only requiring "orderType" to be set.


I've just updated my post to avoid any confusion, base minimum required DTO schema should be 

 

 

 

{
"saleOrderUpdateDto": {
"orderType": {
"value": "ORDERTYPE"
}
}

 

 

unless user wants to update another field/s in particular.

-------------------------
Update: Fix has been planned to be deployed in 8.26 release.
Please follow Visma.net Financials API updates for version 8.26 (November)

Update:
[Release Notes] - Visma.Net API 8.26 - 09.11.2020