My Products
Help

SalesOrder V2 error Error creating salesOrder. Object reference not set to an instance of an object.

by Steinar Møller

Hi,
We getting "Error creating salesOrder. Object reference not set to an instance of an object."   when we post SalesOrder with TenantID authtentication, when we post the same order with Token it works without errors.
This error only occures on a spesific client. Posting with the same code on another client with TenantID works fine. Also tested GET Salesorder from the same client which fails, gives no error.

Please let me know if you need more information.

/Steinar

7 REPLIES 7
Marten Voort
VISMA

by Marten Voort

Hi Steinar, are the update scopes enabled in the 'My Apps' section for this clients specific appstore?

by Steinar Møller

Yes , this is enabled for this client,

SteinarMller_0-1706597796983.png

 

Marten Voort
VISMA

by Marten Voort

Ok, that looks fine! Are you able to retrieve the generic visma.net service token with create scope for this tenant? Be aware that salesorderV2 is NOT using the salesorder specific scopes/endpoints. 

by Steinar Møller

Yes, no problem with generating token, tested both in the code, postman and swagger.

Marten Voort
VISMA

by Marten Voort

A couple of things to check:

Are you able to create other master data in this company using this token?

Is it possible to create the salesorder manually in the UI using the exact same data?

 

by Steinar Møller (Updated ‎30-01-2024 10:42 by Steinar Møller PARTNER )

When using this token, the error occurs, only for salesorderV2, get calls are working.
Yes it is possible to create the salesorder manually in the UI.
It is also working posting the same order with Oauth 2.0 flow.

Marten Voort
VISMA

by Marten Voort

Ok this is helpful information. We need to investigate this further, and because it seems really client sensitive, I advise you to seek country specific support. Please take a look at the following on how to get support. Refer to this post in your initial contact. 

https://community.visma.com/t5/News-in-Developers-Visma-net/Update-on-Visma-net-ERP-API-Support-chan...