I have three different Controller Class which extends SysOperationServiceController Class, In how many ways I can create the batch job , I followed the following article https://dynamicsaxinsight.wordpress.com/2015/04/24/ax-2012-customize-controller-for-batch-job/ But I am finding the following error.
Because previously it existed in the batch.
As you notice, this class has a method called canGoBatch and it returns false. This means that the class can't be set up in batch.
You can modify it to return true but perhaps it will not work correctly. There is some reason why Microsoft set it to not be possible to run in batch.
If you look at the documentation of this class it says that it's supposed to be called from another process.
Why would you like to run it in batch?
Hi Nikaloas,
Thanks a lot for your time and for your valuable words.
The code works, I simply used it in a Job.
Also I have another class ProdReceiptFinalizationController, how will I use it to make batch job.
/// <summary>
/// The <c>ProdReceiptFinalizationController</c> class extends the <c>SysOperationServiceController</c> class
/// and is responsible for generating the metadata for the product receipt finalization request for the
/// <c>ProdReceiptFinalizationOperation</c> journalization batch tasks creation operation and its execution.
/// </summary>
public class ProdReceiptFinalizationController extends SysOperationServiceController
{
public boolean canGoBatch()
{
return false;
}
protected ClassDescription defaultCaption()
{
return "@SYS4000653";
}
}
So this is a standard class and not anything you developed? It would have been great if you had mentioned it earlier. Your question was very generic, but as it turns out your are dealing with a very specific problem. It always makes sense to share as much information as possible already in your first post, this way you can save a lot of your time (and others') and improve the chances of getting your question answered.
Also, already in my first reply I asked you to check if your code has main method. So, it's also good to pay a lot of attention to what others write.
Anyway, you might know that only classes that have Main method can be launched via an action menu item. This class doesn't have main method so you can't launch it via a menu item.
But if you look at cross references, you will find how this batch is initialized by Classes\SysCheckListItem_SysParameters:
Here's the code that you can use:
SrsReportRunRdpPreProcessController::createCleanUpBatchJob();
So, if you create a new class that has a main method and put this piece of code in the main method, then you can point your menu item to your new class and set up this batch.
Actually some of the batch jobs were deleted accidentally but the classe were known so i have to make the batch jobs again, the problem is that when i am creating the batch job via interface i am unable to see my class when making the task, so i am using action menu item to create the batch job.
In class declaration my class name is SrsReportRunRdpPreProcessController which extends sysOperationServiceController class only and there is no declaration or code.
Thanks for sharing your code.
However we can't even see what class it is so it's not very useful. Could you please ready my first reply again and provide the information that I asked? Thanks!
However we can see from the code that you are trying to initialize a batch job in code. Is there some particular reason for it? Normally users set up batch jobs via the user interface unless there's some special requirement. Do you have some special requirement? Could you tell us what you are trying to do?
I don't know. You have to determine if it's useful for you.
Especially without seeing your code there's not much we can do.
Also here is my code
is this article is useful for me?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156