Announcements
Hi ,
I have this dialog :
public void run(Args _args) { dialog.run(); if (dialog.closedOk()) { BatchClass::main(_args); } }
When I click on button "Ok" I want to pass args in the 2end class that extends runBase Batch :
When I click on button Ok , this form will be opening :
public static void main(Args _args) { BatchClass batchClass; batchClass = BatchClass::construct(); batchClass.caption(); if(batchClass.prompt()) { RoleVersion = _args.record(); //When I run this code on batch the value of // Role version was nul RoleVersion.run(); } }
I don't understand why args is null when I run this class in batch.
About my recommendations - if you followed then, then you must have adjusted your code. So far we have never seen your full batch class code. It might be useful if you could share your code with us, allowing us to spot possible issues in it.
You can set the "Execute business operations in CIL" in your user options -> Development tab.
And actually this info can be found also by doing a web search for "dynamics ax 2012 execute business operations in CIL". I always recommend first asking from a web search engine, only then from other people :) This way you will get quicker results.
Hi,
@Nikolaos Mäenpää , yes I looked at your recommendations but always I have the same issue.
@Martin Dráb , I set the business operations in CIL = No => but I get the same result
Try running main() on client and run() on server (with Execute business operations in CIL = No). I suspect you'll already find a problem there and you won't have to either run or debug a batch. Even if you find that it works, it will be extremely valuable information (proving that serialization etc. works correctly).
Then try it with Execute business operations in CIL = Yes. If it stops working, we'll know that your problem is related to CIL.
Only if all these things work, it's time to test batch jobs.
Hi Basma WED,
You can install Visual Studio or ask someone to install it for you. This way you can debug the batch.
Meanwhile, did you already have a chance to look at my recommendations in my 2 previous messages?
HI Martin , I havnt visual studio in my VM to debug the batch
Do you have any specific reason for not using the debugger and not following the steps of debugging I suggested in my reply?
Debugger is the most powerful tool you have for debugging and ignoring it doesn't look wise to me.
HI,
I add info in the method run like this :
public void run() { EUKSecurityRole eukSecurityRole; info(_roleNameGlb); // packed value info(int642str(_matrixRoleVersion.RecId)); eukSecurityRole = EUKSecurityRole::construct(_roleNameGlb, _matrixRoleVersion); }
Ah, one more thing.
When you use RunBaseBatch, please put all your business logic in the run method of the class (or call it from the run method).
You can use class Tutorial_RunbaseBatch class as an example.
Perhaps this explains your problem.
Thanks for the clarification.
And what values "are always null" in batch? Did you debug it? Can you show a screenshot where we see the values in the debugger? Or did you just determine that the values are null, based on the output of the batch? Please share all possible info with us so that we are in the same page and can help you as good as possible.
Basically it should work the same way in batch and no-batch.
One thing you can try is to clear your usage data and then run the batch again.
I means by "that is what I do in the main method of batch class, but the values always null" =>when I set up the batch
in the other case :
the code was executed without problem
André Arnaud de Cal...
294,251
Super User 2025 Season 1
Martin Dráb
232,984
Most Valuable Professional
nmaenpaa
101,158
Moderator