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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Facing issue while sales order packing slip posting

(0) ShareShare
ReportReport
Posted on by 14

i am try to do packing slip posting for sales order, all the setups are done , inventory is available but getting one generic error "Exception has been thrown by the target of an invocation."

pastedimage1663751383369v1.png
NOTE: this error persists for all sales order packing slip posting, other processes are working fine.


Tried to debug the issue and got that this process exits out of code when this.endpost() is called in FormLetterJournalPost class (method : Post()), the debugger doesnt enter the code and exits directly to the last braces of post() method.

i kept debugger on end post method too but that doesnt work. No further customization have been done on same method, hence breaking up on the standard code itself

i tried full build, usage data clearing, iis reset, database sync, services restart, would like some expert advice in field of d365 Finance and operations

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    306,446 Super User 2026 Season 1 on at

    Hi Palak,

    If there are no customizations in place, I would suggest reviewing if it might be related to e.g. printing or sending of the packing slip. Is this happening in only one environment or multiple environments?

  • Anonymous Profile Picture
    14 on at

    Hi Andre,

    this happened earlier in UAT(testing environment) where i was not having debugger access, but this time its happening in developement environemnt. This errors pops up randomly in diffrent environement and vanishes.

    About printing, i was trying to post packing slip without printing, also with printing to screen but the issue persists

    Thanks

    Palak

  • Martin Dráb Profile Picture
    240,196 Most Valuable Professional on at

    Sure, the process exists because an exception is thrown. That's what the infolog message said too.

    What you need to do is getting the exception object and extract more information from it. When the exception is thrown, you'll probably see a special variable called $exception (at Locals pane). There look at its InnerException property, which should contain the actual exception, and check out its type, Message and StackTrace.

  • Anonymous Profile Picture
    14 on at

    Thanks for the heads up martin, but actually that inner exception is coming up as null

    pastedimage1663838813310v1.png

  • Martin Dráb Profile Picture
    240,196 Most Valuable Professional on at

    It seems that $exception already contains what you need please look at its, Message and StackTrace. If you need help from us, share this information here.

  • Anonymous Profile Picture
    14 on at

    below is message and trace let me know  how to understand the error

    Message : "Posting\tAn error occurred during update"

    stack trace :"   at Dynamics.AX.Application.SysOperationSandbox.`executeInNewSessionAndWaitForCompletion(SysOperationIMarshalledRun operationInstance, Object[] serializedMethodInfo, String waitCaption, String operationCompletedMessage, String cancellationMessage, Boolean @operationCompletedMessage_IsDefaultSet, Boolean @cancellationMessage_IsDefaultSet) in xppSource://Source/ApplicationPlatform\\AxClass_SysOperationSandbox.xpp:line 259\r\n   at Dynamics.AX.Application.SysOperationSandbox.executeInNewSessionAndWaitForCompletion(SysOperationIMarshalledRun operationInstance, Object[] serializedMethodInfo, String waitCaption, String operationCompletedMessage, String cancellationMessage, Boolean @operationCompletedMessage_IsDefaultSet, Boolean @cancellationMessage_IsDefaultSet)\r\n   at Dynamics.AX.Application.SysOperationSandbox.executeInNewSessionAndWaitForCompletion(SysOperationIMarshalledRun operationInstance, Object[] serializedMethodInfo, String waitCaption)\r\n   at Dynamics.AX.Application.SysOperationSandbox.`startOperation(SysOperationIMarshalledRun operationInstance) in xppSource://Source/ApplicationPlatform\\AxClass_SysOperationSandbox.xpp:line 72\r\n   at Dynamics.AX.Application.SysOperationSandbox.startOperation(SysOperationIMarshalledRun operationInstance)\r\n   at Dynamics.AX.Application.SysOperationServiceController.`runOperation() in xppSource://Source/ApplicationFoundation\\AxClass_SysOperationServiceController.xpp:line 548\r\n   at Dynamics.AX.Application.SysOperationServiceController.runOperation()\r\n   at Dynamics.AX.Application.SysOperationController.`startOperation() in xppSource://Source/ApplicationFoundation\\AxClass_SysOperationController.xpp:line 2034\r\n   at Dynamics.AX.Application.SysOperationController.startOperation()\r\n   at Dynamics.AX.Application.SysOperationServiceController.`startOperation() in xppSource://Source/ApplicationFoundation\\AxClass_SysOperationServiceController.xpp:line 896\r\n   at Dynamics.AX.Application.SysOperationServiceController.startOperation()\r\n   at Dynamics.AX.Application.SalesFormLetter.`main(Args args) in xppSource://Source/Foundation\\AxClass_SalesFormLetter.xpp:line 2676\r\n   at Dynamics.AX.Application.SalesFormLetter.main(Args args)\r\n   at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)"

  • Martin Dráb Profile Picture
    240,196 Most Valuable Professional on at

    Let me make it easier to read:

    Dynamics.AX.Application.SysOperationSandbox.`executeInNewSessionAndWaitForCompletion(S...)
    in xppSource://Source/ApplicationPlatform\\AxClass_SysOperationSandbox.xpp:line 259
    at Dynamics.AX.Application.SysOperationSandbox.executeInNewSessionAndWaitForCompletion(SysOperationIMarshalledRun operationInstance, Object[] serializedMethodInfo, String waitCaption, String operationCompletedMessage, String cancellationMessage, Boolean @operationCompletedMessage_IsDefaultSet, Boolean @cancellationMessage_IsDefaultSet)
    at Dynamics.AX.Application.SysOperationSandbox.executeInNewSessionAndWaitForCompletion(SysOperationIMarshalledRun operationInstance, Object[] serializedMethodInfo, String waitCaption)
    at Dynamics.AX.Application.SysOperationSandbox.`startOperation(SysOperationIMarshalledRun operationInstance) in xppSource://Source/ApplicationPlatform\\AxClass_SysOperationSandbox.xpp:line 72
    at Dynamics.AX.Application.SysOperationSandbox.startOperation(SysOperationIMarshalledRun operationInstance)
    at Dynamics.AX.Application.SysOperationServiceController.`runOperation() in xppSource://Source/ApplicationFoundation\\AxClass_SysOperationServiceController.xpp:line 548
    at Dynamics.AX.Application.SysOperationServiceController.runOperation()
    at Dynamics.AX.Application.SysOperationController.`startOperation() in xppSource://Source/ApplicationFoundation\\AxClass_SysOperationController.xpp:line 2034
    at Dynamics.AX.Application.SysOperationController.startOperation()
    at Dynamics.AX.Application.SysOperationServiceController.`startOperation() in xppSource://Source/ApplicationFoundation\\AxClass_SysOperationServiceController.xpp:line 896
    at Dynamics.AX.Application.SysOperationServiceController.startOperation()
    at Dynamics.AX.Application.SalesFormLetter.`main(Args args) in xppSource://Source/Foundation\\AxClass_SalesFormLetter.xpp:line 2676
    at Dynamics.AX.Application.SalesFormLetter.main(Args args)
    at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)

    Unfortunately you're looking at a generic exception thrown by SysOperation framework. You should debug what happens inside the operation called by SysOperation framework, instead of catching an exception outside of the framework.

    Try putting a breakpoint to Info.add() and checking where "Exception has been thrown by the target of an invocation" message is added to infolog. It might already show you the exception, or at least where you should add a breakpoint.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

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

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 265 Most Valuable Professional

#3
Subra Profile Picture

Subra 262

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans