Notifications
Announcements
No record found.
Hello,
I created a runBaseBatch classe where i export data to csv file. It work fine on interactive mode. On the others side not work en batch mode.
any help in this regard
*This post is locked for comments
First of all, fix the way how you're testing your code. You claim it works fine in the interactive mode, but it the condition isInBatch() caused the code to be skipped, therefore you didn't test anything. Remove the condition, make sure that the class runs on server and try it again. Next time, use the debugger to make sure that the code you're trying to debug actually runs.
If you reproduce the error, catch the CLRException and look at its type, message and so on. Knowing what error you get is the first step to fixing it.
By the way, please make sure you set the version tag correctly (you had AX 2009 in the title and AX 2012 in the version tag).
Hi,
Please give readwrite permissoin to the file and give a try.
Thanks,
Chaitanya Golla
Hello Martin , i posted only a part of the code .No you can find all my code i updated the request
I see you still have two different pieces of logic, depending on whether the code runs in batch or not. Why? Maintaining and testing the same things twice looks like a waste of time to me.
You probably don't realize that you can use common logic for both. It's exactly what you I would do.
If you insist on having two different ways, you must learn how to debug batch jobs, because you make it impossible for yourself to debug it interactivelly (see Step-by-Step Checklist for Debugging Batch Jobs in Dynamics Ax). But I wouldn't bother; I would use the same logic.
I also believe that you don't realize that your WinAPI code will run on client, while the batch will run on a batch server, i.e. a completely different computer. Also, it will use a different user (the AOS service account).
And you try/catch clause doesn't cover all code. Fix it, catch the CLRException and look at it, as I told you before.
I have same problem.
The code works on server side. When I'm trying to invoke this code:
on line3 i get an error:
ClrObject static method invocation error.
I think the problem with CAS system.Also I don't know how to solve it.
I tryied to use
but this don't work. Anybody solve this problem?
I don't dare guessing what the exception might be. Instead of guessing, I would catch the CLR exception look at its details, such as the InnerException.
If the problem was in CAS, it would fail even before making the call. Your case looks different - FromBase64String() gets called but it throws an exception. And finding what exception it is was is the crucial step.
The most likely explanation is that sTmp isn't actually a Base64 string.
I wrapped the code to try...catch construction and catch a detailed error. In my case, the Base64 string wasn't correct. I generated a Base64 string the app Notepad++ and generate a string without a padding symbol. I just added to the end of Base64 string the symbol '=' and solve my problem.
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.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2