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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Getting exception indexoutodbound while posting packingslip

(0) ShareShare
ReportReport
Posted on by

hi team,

i have written a custom code to confirm and post packing slip of loads available in all loads form.

when the code is ran it it comfirms the shipment and load status get changed to shipped, however when it attempts to post packing slip it throws an exception stating index outofbound, when I debugged I found that this exception is coming from formletterservice. Runsinglethread() method.

thanks

I have the same question (0)
  • Martin Dráb Profile Picture
    238,787 Most Valuable Professional on at

    You need to find the exact place.

    Look at the StackTrace property of the exception (in debugger), it may contain this information.

  • Karuna Dogra Profile Picture
    on at

    Hi Martin,

    I rechecked it and now its neither  throwing any exception nor it’s posting the packing slip.

    I debugged and found that in formletterservice.service() is returning formletterparmtable as 0

    And in the runsinglethread(printout _printout) its not getting inside the while loop while(this. Continueselect())

    Also (formletterparmupdate) is blank in endparmupdate() method of formletterservice class.

    Not sure what’s missing which is causing these things as blank.

    Below is the code which I am using to post the packing sllip

  • Karuna Dogra Profile Picture
    on at

    1856.image.jpg

  • Martin Dráb Profile Picture
    238,787 Most Valuable Professional on at

    It seems that if found nothing to post, probably because the order isn't in the right state.

    If you try to post it manually, you'll likely see no lines in the dialog.

    If you have no idea about what's going on, you can debug the process generating parm data (in SalesFormletterParmDataPackingslip class).

  • Karuna Dogra Profile Picture
    on at

    Manual posting in this is working fine.

  • Karuna Dogra Profile Picture
    on at

    It seems like its not processing the data in salesformletterparmdstapackingslip class… but the above code i shared seems fine then why it not processing it further. Can you please suggest. It’s a bit urgent . Your help will be much appreciated.

    Thanks

  • Karuna Dogra Profile Picture
    on at

    this is the exception


    Microsoft.Dynamics.Ax.Xpp.ClrErrorException: IndexOutOfRangeException ---> System.IndexOutOfRangeException: Index was outside the bounds of the array. at Microsoft.Dynamics.Ax.Xpp.Set.create(Object[] _container) in D:\dbs\sh\l23t\1129_211751\cmd\u\Source\Kernel\xppil\XppSupport\Set.cs:line 260 at Dynamics.AX.Application.SalesPackingSlipJournalPost.`updateJournalTable() at Dynamics.AX.Application.SalesPackingSlipJournalPost.updateJournalTable() at Dynamics.AX.Application.FormletterJournalPost.post() at Dynamics.AX.Application.FormletterJournalPost.`run() at Dynamics.AX.Application.FormletterJournalPost.FormletterJournalPostCoCHelper.`run(FormletterJournalPost instance) at Dynamics.AX.Application.FormletterJournalPostSubBillDeferral_Extension.run(FormletterJournalPost this) at Dynamics.AX.Application.FormletterJournalPost.FormletterJournalPostCoCHelper.`run(FormletterJournalPost instance) at Dynamics.AX.Application.FormletterJournalPost.run() at Dynamics.AX.Application.SalesPackingSlipJournalPost.`run() at Dynamics.AX.Application.SalesPackingSlipJournalPost.run() at Dynamics.AX.Application.FormletterService.`postJournal(Common _parmTable) at Dynamics.AX.Application.FormletterService.postJournal(Common _parmTable) at Dynamics.AX.Application.FormletterService.`createAndPostJournal() at Dynamics.AX.Application.FormletterService.FormletterServiceCoCHelper.`createAndPostJournal(FormletterService instance) at Dynamics.AX.Application.AVA_FormLetterService_Extension.createAndPostJournal(FormletterService this) in xppSource://Source/AVA Model\AxClass_AVA_FormLetterService_Extension.xpp:line 38 at Dynamics.AX.Application.FormletterService.FormletterServiceCoCHelper.`createAndPostJournal(FormletterService instance) at Dynamics.AX.Application.FormletterService.createAndPostJournal() at Dynamics.AX.Application.FormletterService.`processJournal(Printout _printout) at Dynamics.AX.Application.FormletterService.FormletterServiceCoCHelper.`processJournal(FormletterService instance, Printout arg0) at Dynamics.AX.Application.RevRecFormLetterService_Extension.processJournal(FormletterService this, Printout _printout) at Dynamics.AX.Application.FormletterService.FormletterServiceCoCHelper.`processJournal(FormletterService instance, Printout arg0) at Dynamics.AX.Application.FormLetterServiceTAS_Extension.processJournal(FormletterService this, Printout _printout) in xppSource://Source/TAS\AxClass_FormLetterServiceTAS_Extension.xpp:line 23 at Dynamics.AX.Application.FormletterService.FormletterServiceCoCHelper.`processJournal(FormletterService instance, Printout arg0) at Dynamics.AX.Application.FormletterService.processJournal(Printout _printout) at Dynamics.AX.Application.FormletterService.`processFormLetterParmTable(Printout _printout) at Dynamics.AX.Application.FormletterService.processFormLetterParmTable(Printout _printout) at Dynamics.AX.Application.FormletterService.`runSingleThread(Printout _printout) at Dynamics.AX.Application.FormletterService.runSingleThread(Printout _printout) at Dynamics.AX.Application.FormletterService.`run() at Dynamics.AX.Application.FormletterService.run() at Dynamics.AX.Application.FormletterService.`postSalesOrderPackingSlip(SalesFormLetterPackingSlipContract _contract) at Dynamics.AX.Application.FormletterService.postSalesOrderPackingSlip(SalesFormLetterPackingSlipContract _contract) at FormletterService::postSalesOrderPackingSlip(Object , Object[] , Boolean& ) at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeInstanceCall(Object instance, String MethodName, Object[] parameters) in D:\dbs\sh\l23t\1129_211751\cmd\u\Source\Kernel\xppil\XppSupport\ReflectionCallHelper.cs:line 1947 --- End of inner exception stack trace --- at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeInstanceCall(Object instance, String MethodName, Object[] parameters) in D:\dbs\sh\l23t\1129_211751\cmd\u\Source\Kernel\xppil\XppSupport\ReflectionCallHelper.cs:line 1992 at Microsoft.Dynamics.Ax.Xpp.DictClass.Callobject(String _methodName, XppObjectBase _Called, Object[] varArgs) in D:\dbs\sh\l23t\1129_211751\cmd\u\Source\Kernel\xppil\XppSupport\DictClass.cs:line 183 at Dynamics.AX.Application.SysOperationServiceController.runOperationInstance(SysOperationServiceController controller) at Dynamics.AX.Application.SysOperationServiceController.runOperationSynchronously() at Dynamics.AX.Application.SysOperationServiceController.`run() at Dynamics.AX.Application.SysOperationServiceController.run() at Dynamics.AX.Application.FormLetterServiceController.`run() at Dynamics.AX.Application.FormLetterServiceController.run() at Dynamics.AX.Application.SalesFormLetter.`run() at Dynamics.AX.Application.SalesFormLetter.run() at Dynamics.AX.Application.SalesFormLetter.`update(Common _source, Date _transDate, SalesUpdate _specQty, AccountOrder _accountOrder, NoYes _proforma, NoYes _printFormLetter, NoYes _usePrintManagement, NoYes _creditRemaining, Object[] _packedTmpFrmVirtualList, Boolean _storno, Boolean _stornoPhysical, Boolean @_transDate_IsDefaultSet, Boolean @_specQty_IsDefaultSet, Boolean @_accountOrder_IsDefaultSet, Boolean @_proforma_IsDefaultSet, Boolean @_printFormLetter_IsDefaultSet, Boolean @_usePrintManagement_IsDefaultSet, Boolean @_creditRemaining_IsDefaultSet, Boolean @_packedTmpFrmVirtualList_IsDefaultSet, Boolean @_storno_IsDefaultSet, Boolean @_stornoPhysical_IsDefaultSet) at Dynamics.AX.Application.SalesFormLetter.update(Common _source, Date _transDate, SalesUpdate _specQty, AccountOrder _accountOrder, NoYes _proforma, NoYes _printFormLetter, NoYes _usePrintManagement, NoYes _creditRemaining, Object[] _packedTmpFrmVirtualList, Boolean _storno, Boolean _stornoPhysical, Boolean @_transDate_IsDefaultSet, Boolean @_specQty_IsDefaultSet, Boolean @_accountOrder_IsDefaultSet, Boolean @_proforma_IsDefaultSet, Boolean @_printFormLetter_IsDefaultSet, Boolean @_usePrintManagement_IsDefaultSet, Boolean @_creditRemaining_IsDefaultSet, Boolean @_packedTmpFrmVirtualList_IsDefaultSet, Boolean @_storno_IsDefaultSet, Boolean @_stornoPhysical_IsDefaultSet) at Dynamics.AX.Application.SalesFormLetter.update(Common _source, Date _transDate, SalesUpdate _specQty, AccountOrder _accountOrder, NoYes _proforma, NoYes _printFormLetter, NoYes _usePrintManagement, NoYes _creditRemaining) at Dynamics.AX.Application.Test.`test() in xppSource://Source/PACExt\AxClass_Test.xpp:line 28 at Dynamics.AX.Application.Test.test() at Dynamics.AX.Application.Test.`main(Args _args) in xppSource://Source/PACExt\AxClass_Test.xpp:line 14 at Dynamics.AX.Application.Test.main(Args _args) at Test::Main(Object[] , Boolean& ) at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters) in D:\dbs\sh\l23t\1129_211751\cmd\u\Source\Kernel\xppil\XppSupport\ReflectionCallHelper.cs:line 1630 at Dynamics.AX.Application.SysClassRunnerHelper.`runMainMethod(SysClassRunnerState state) at Dynamics.AX.Application.SysClassRunnerHelper.runMainMethod(SysClassRunnerState state) at Dynamics.AX.Application.Forms.SysClassRunner.FormControl.timerControl.elapsed()
    Index was outside the bounds of the array.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 512 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 386

#3
Adis Profile Picture

Adis 259 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans