web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Business Central forum

Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLArgumentOutOfRangeException

(0) ShareShare
ReportReport
Posted on by 56

I am getting this error when I'm posting a Sales Order:

"Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLArgumentOutOfRangeException"

I have a event subscribtion to Codeunit 80, "OnAfterPostSalesDoc" because it is then uploaded to a webservice.

The upload takes part in slices of the pdf, so we have to store the data in a List of Bytes

When debugging it shows that the error occurs around here:

UploadSlice(UploadId, FileBytes.GetRange(Pos, FileBytes.Count() - Pos), Pos);
Could it be that the Pdf is too large and exceeds the length of the List Data type or what else could be the reason?
Thank you in advance for your help!

Categories:
I have the same question (0)
  • Verified answer
    Avinash B Profile Picture
    1,455 on at

    Hi,

    I remember when the value of the arguments is incorrect, I faced this error. Check the value of the argument passed to the UplaodSlice or GetRange function. There may be a possibility that the values may be incorrect.

    Regards

    Avinash B

  • Mkublbock Profile Picture
    56 on at

    Hey, thanks for your answer

    The values seem to be correct. UploadId = 1 and in GetRange, the position = 1. I, however, cannot see the value of FileBytes.Count()

    Edit: I just assigned the FileByte count to a variable and it seems that it's 0 somehow. 

    Thanks a lot, gonna take a look into ti  

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans