Notifications
Announcements
This is my code , I made a ssrs report , so in RDP class (Process report method) I write a while loop to add values in tmp table based on General Journal trans table .
I called a method in class and put it in try catch to handle errors But report throw an error and didn't hit a catch statement How to fix it ?
First of all, isn't try try/catch statement in a transaction? If so, it explains everything.
Are you saying if use "Step into" or something, the catch block is skipped?
What is your version of AX?
Yes , I put a ttsbegin and ttscommit before and after my while loop to insert in tmp table , inside this while loop I put a try and catch in method get an error to handle errors .
version of AX d365fo
That's reason - you catch exceptions inside a transaction.
(Moved from Dynamics AX Forum.)
I can't understand what to do , Can you explain please ? , I try to run my code in a runnable class and it works but doesn't work in report
What you need to do depends on what exactly you're trying to achieve.
For example, maybe you don't need any transaction at all. If things fail, you'll throw an exception, the processing will be interrupted, the temporary table will get out of scope and the inserted data will ceased to exist together with it.
how can I do this ? the method I called is a void method didn't return any thing ?
there is any way to check if this method get an error then I will insert in tmp table
I try to put an ttsbegin , ttscommit before and after intert of tmp table (outside catch statement) and also doesn't work
I add values in temp table based on errors in infolog , I loop on infolog and based on every single error I put enum values in temp table
You created a duplicate threads about the same thing, and when I pointed it out, you said: "I asked you another questions but you didn't answer". But what is the question? I have no idea what you mean by your last reply, but I can say for sure that it's not a question.
I mean that my issue didn't work so I asked another question in community if anyone know how to fix it ,or If anyone have another workaround
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Abhilash Warrier 836 Super User 2025 Season 2
André Arnaud de Cal... 441 Super User 2025 Season 2
Martin Dráb 346 Most Valuable Professional