My Products
Help
sallbergerik
CONTRIBUTOR ***

Error in PrintOrder for SalesOrder

by sallbergerik

Hello, I get the following error when I try to printorder for a sales order in

Swagger.

 

Thankful for help to understand what is wrong and if there's anything I can do to fix the problem.

 

{
  "message": "An error has occurred.",
  "exceptionMessage": "The 'CompressedContent' type failed to serialize the response body for content type 'application/octet-stream'.",
  "exceptionType": "System.InvalidOperationException",
  "stackTrace": null,
  "innerException": {
    "message": "An error has occurred.",
    "exceptionMessage": "You do not have enough rights to access SO64118S.",
    "exceptionType": "PX.Data.PXException",
    "stackTrace": "   at PX.Data.Reports.PXReportTools.FindReport(String screenID)\r\n   at PX.Data.Reports.PXReportTools.LoadReport(String reportID, IPXResultset incoming)\r\n   at Visma.net.ERP.Api.Common.Repository.ReportRepository.GetReportStream(String reportId, Dictionary`2 parameters) in D:\\Data\\BuildAgent\\work\\11023e52ea15d342\\Web\\Lib\\Visma.net.ERP.Api\\Common\\Repository\\ReportRepository.cs:line 16\r\n   at Visma.net.ERP.Api.SO.Repository.SOOrderRepository.PrintOrder(String orderNumber, String orderType, Stream outputStream) in D:\\Data\\BuildAgent\\work\\11023e52ea15d342\\Web\\Lib\\Visma.net.ERP.Api\\SO\\Repository\\SOOrderRepository.cs:line 954\r\n   at Visma.net.ERP.Web.Api.Controllers.V1.SalesOrderController.<>c__DisplayClass10_0.<PrintOrder>b__0(Stream outputStream, HttpContent httpContent, TransportContext transportContext) in D:\\Data\\BuildAgent\\work\\11023e52ea15d342\\Web\\Lib\\Visma.net.ERP.Web.Api\\Controllers\\V1\\SalesOrderController.cs:line 187\r\n   at System.Net.Http.PushStreamContent.<>c__DisplayClass7_0.<Taskify>b__0(Stream stream, HttpContent content, TransportContext transportContext)\r\n   at System.Net.Http.PushStreamContent.<SerializeToStreamAsync>d__8.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n   at PX.Api.Compression.BaseCompressor.<Compress>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n   at PX.Api.Compression.CompressedContent.<SerializeToStreamAsync>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n   at System.Web.Http.WebHost.HttpControllerHandler.<WriteBufferedResponseContentAsync>d__22.MoveNext()"
  }
}

 

4 REPLIES 4

by Magnus Johnsen

Hi,

Could you please try the action on the UI with the same user so that we can rule out if the issue is with the API or the User/ERP.

Thank you.

sallbergerik
CONTRIBUTOR ***

by sallbergerik

I don't have access to the orders in the UI. The customer could download the file.

I suspect that the problem is the fact that I don't have access to orders in the UI because I tried on another account where I have full access and then it worked.

 

I also tried to download a shipment confirmation file and got the same error:

{
  "message": "VismaId: a4d9dd01-87c8-47a9-947e-49c432d7da13. You do not have enough rights to access SO64200S."
}

 I'm going to ask the customer to give me more access and hopefully that solves the problem.

Accepted solution
sallbergerik
CONTRIBUTOR ***

by sallbergerik

I got extended access (Purchasing Administrator, Sales Administrator, Warehouse Administrator) to the customers account and that solved the problem.

by Magnus Johnsen

Hi,

Perfect, make sure you have both the "Financials User" & the "Financial Administrator" at the very least.
Glad too hear you figured it out.