My Products
Help
Anonymous
Not applicable

An error when adding lines to SalesOrder: "Object reference not set to an instance of an object"

by Anonymous

PUT request to https://integration.visma.net/API/controller/api/v1/salesorder gives error:

HTTP status 500

{message:"VismaId: c8db4134-cf81-494a-974d-24add4f1e38e. Object reference not set to an instance of an object."}

 

What's that? Why's that? What can we do about it?

Thanks in advance!

 

Example:

IPP-Company-Id: 2649567

Request:

PUT https://integration.visma.net/API/controller/api/v1/salesorder/601516

PUT https://integration.visma.net/API/controller/api/v1/salesorder/601516
{
    "lines": [
        {
            "operation": "Insert",
            "inventoryId": {
                "value": "Wallmount"
            },
            "quantity": {
                "value": 1
            },
            "unitPrice": {
                "value": 800
            },
            "discountAmount": {
                "value": 0
            },
            "lineNbr": {
                "value": "2"
            }
        }
    ],
    "orderType": {
        "value": "SO"
    }
}

 

7 REPLIES 7
Yıldırım
VISMA

by Yıldırım (Updated ‎16-09-2020 12:00 by Yıldırım VISMA )

Hello, 

 

Could you make sure that the sent "InventoryID" exists in the Financials company ? Please also check the Sales Order's (601516 ) Type in the UI, or you can try a GET request with /salesorder/{orderNbr}

 

 

 

Anonymous
Not applicable

by Anonymous

Yup, that SalesOrder exists - we are able to retrieve it. (had done that prior to trying to add lines)

 

Yup, this InventoryId exists. That SalesOrder contains existing lines with this InventoryId.

Anonymous
Not applicable

by Anonymous

And yeah - it is retrievable via salesorder endpoint.

Yıldırım
VISMA

by Yıldırım (Updated ‎16-09-2020 15:40 by Yıldırım VISMA )

Can you try to add then save the same Sales Order Line manually on the UI and see if Financials ERP prompts any error message/s ?  Please also send us a print screen highlighting the lines( If it contains sensitive data, you can send this to developer@visma.com )

Anonymous
Not applicable

by Anonymous

We do not have access to the UI itself - we are providing an integration solution only. So, we are now negotiating that "experiment" with the customer.

 

Meanwhile, here are some details that might be valuable:

Looks like this SalesOrder has been shipped already. Is it allowed or forbidden to add lines to shipped SalesOrders? (where can we get info on other such rules?)

Anonymous
Not applicable

by Anonymous

(I mean, we do not have access to the UI of a customer's account)

Accepted solution
Yıldırım
VISMA

by Yıldırım (Updated ‎17-09-2020 09:59 by Yıldırım VISMA )

API adheres to rules of the Financials ERP so your best guide in having a good grasp of transactions and its requirements is UI.   

- There are training materials for both ERP & API available at Visma Academy
-Visma.net Financials ERP Online Documentation : 
https://knowledge-and-support-center.visma.net/WebClient/?integrationId=368910de-30a3-489b-b932-e6a3...

Once Sales Order has been shipped, it's not allowed to modify the document.

SalesOrder_Shipping.png

 

 

 

 

 

 

 

 

 

 

API should return the following error
PUT.png