LeaderBoard

Manage batch jobs AX 2012

After you create and schedule a batch job, you might want to check its status, review its history, or cancel it. The following sections describe some of the most common management tasks associated with batch jobs.

View and change the batch job status
The Batch Job list form provides a snapshot view of the current state of batch jobs. The list displays the progress and the status of running and completed jobs. It also displays any jobs that are scheduled to start soon.
You can change the status of a batch job by selecting the batch job in the list and then following these steps:
1. Click Functions, and then click Change Status.
2. In the Select New Status dialog box, select a new status for the job. For example, if the status is Waiting, you can temporarily remove the batch job from the waiting list by changing the status to Withhold.

Tip If a job exits with a status of Error/Ended and you want to rerun the job, change its status to Waiting. The job will automatically be picked up by the server for execution.

You can cancel a batch job by changing its status to Canceling. Tasks in the Waiting or Ready state are changed to Not Run; currently executing tasks are interrupted, and their status is changed to Canceled.

Control the maximum retries
If an AOS fails because of an infrastructure failure or a power outage while a batch task is executing, the batch framework has the built-in capability to retry tasks after the AOS is restarted. Any tasks that were left in an executing state, and that have not reached the maximum retry limit, are changed to the Ready state and will run shortly after the failure.

Tip If you create custom tasks and want to enable retries, design the task so that it is idempotent—that is, it can be executed multiple times without unexpected consequences.

You can modify the Maximum Retries attribute for each batch task on the General tab. By default, the value is set to 1; when the Actual Retries field on the Update tab exceeds the maximum number of retries, the batch task fails. When this happens, the recurrence that is set for the batch job is not honored, and the status of the batch job is set to either Success or Error.

Review the batch job history
You can view a history of all batch jobs that have finished running in the Batch Job History form at System Administration > Inquiries > Batch Job History. This form displays detailed information about the status of the jobs, including any messages encountered while the batch job was running.

You can also view the logs for each batch job as follows:
■ To view log information for an entire batch, select a batch job, and then click Log.
■ To view log information for individual tasks, select a batch job, and then click View Tasks. In the Batch History list form, select a task, and then click Log.

Tip In the batch job settings, you can specify when log information is written to the history tables: Always (the default), On Error, or Never. Use On Error or Never to save disk space for batch jobs that run constantly. This option is located on the General tab of the
Batch Job form.

Inside Dynamics AX 2012 Book

Manage batch execution AX 2012

The final step in implementing a batch job is to manage the execution process. Before a batch job can be executed on an AOS instance, you must configure the AOS instance as a batch server and set up the batch groups that tell the system which AOS instance should execute the job.
In addition to these initial configuration tasks, you’ll likely need to manage the batch tasks and jobs: checking status, reviewing history, and sometimes canceling a batch job. You’ll probably also need to debug a batch task at some point.
The following sections describe how to configure an AOS instance as a batch server and set up batch groups, and the next 2 posts will describe manage batch jobs and debug a batch task.
Configure the batch serverYou can configure an AOS instance to be a batch server, including specifying when the batch server is available for processing and how many tasks it can run, by using the Server Configuration form.
The Server Configuration form is located at System Administration > Setup > System > Server Configuration.
Note that the first AOS instance is automatically designated as a batch server, but you can configure additional AOS instances manually as batch servers.

Tip Use multiple batch servers to enable parallel processing and increase processing throughput.
1. In the Server Configuration form, select a server in the left pane.
2. Select the Is Batch Server check box to enable batch processing on the server, as shown in Figure below.
image
3. On the Batch Server Schedule FastTab, click Add to enter a new schedule. Enter the maximum number of batch tasks that can be run on the AOS instance at one time. The server continues to pick up tasks from the queue until it reaches its maximum.
4. Enter a starting time in Start Time and an ending time in End Time to specify the time window in which the server processes batch jobs. Press Ctrl+N to enter an additional time window.
Tip It’s a good idea to exclude a server from batch processing when it is busy processing regular transactions. You can set server schedules so that each AOS instance is available for user traffic during the day and batch traffic overnight. Keep in mind that if the server
is running a task when its batch processing availability ends, the task continues running to completion. However, the server doesn’t pick up any more tasks from the queue.
Create a batch group
A batch group is a logical categorization of batch tasks that lets a user (typically a system administrator) determine which AOS instance runs the batch task. This section describes how to create a batch group so that it can be assigned to a specific server for execution. The first step is to create batch groups by using the Batch Group form at System Administration > Setup > Batch Group.
To create a batch group, press Ctrl+N in the Batch Group form, and then type a name and description for the batch group. The Batch Group form is shown in below
image
Note By default, the system contains an empty batch group that can’t be removed. This is a default batch group for tasks that are not explicitly assigned to a group.
After you create batch groups, assign each group to a server as follows:
1. In the Server Configuration form (shown in Figure below), click the Batch Server Groups FastTab.
The Selected Groups list shows the batch groups specified to run on the selected server.
2. In the Remaining Groups list, select a group, and then click the left arrow button to add this group to run on the selected server.
image
Note  you can assign each group to a server using Batch Servers in Batch Group form
Imparted from Inside Dynamics AX 2012 Book

Create and execute a batch job AX 2012

Microsoft Dynamics AX 2012 includes numerous batch jobs that perform operations such as generating reports, creating sales invoices, and processing journals. However, in several situations, organizations need to create their own batch jobs. The batch framework provides full flexibility in the types of jobs that you can create. This section walks you through the following steps, which are required for creating, executing, and managing a batch job:
1. Create a batch-executable class.
2. Create a batch job and define the execution schedule.
3. Configure a batch server and create a batch group. (It be will explained in another post)
4. Manage the batch job. (It be will explained in another post)
Create a batch-executable class
The first step in developing a batch job is to define a class that can be executed as a batch task. Many classes included with Microsoft Dynamics AX 2012 are already enabled for batch processing. You can also design a batch-executable class, as shown in the following example:
public class ExampleBatchTask extends RunBaseBatch

Batch processing in Microsoft Dynamics AX 2012

Batch processing is a non interactive task-processing technique where users create batch jobs to organize appropriate types of tasks to be processed as a unit. Batch processing has some important advantages: it lets users schedule batch tasks and define the conditions under which they execute, add the tasks to a queue, and set them to run automatically on a batch server.
After execution is complete, the batch server logs any errors and sends alerts.
A batch job might involve printing reports, closing inventory, or performing periodic maintenance. By scheduling a batch job to process these types of resource-intensive tasks in off-peak hours, users can avoid slowing down the system during working hours.
Table below describes how standard batch processing concepts are represented in Microsoft Dynamics AX.

Troubleshoot the reporting framework [AX 2012]

The report server cannot be validatedIf you cannot validate the report server, do the following:
■ Click the Create button in the Reporting Servers form, which is located at Tools > Business Intelligence Tools > Reporting Servers, and make sure that a report folder and data source have been created on the report server. Click the Validate button.
■ Ensure that firewall settings are configured appropriately on the computer that is running the
report server.
■ Ensure that both the report manager and report server URLs are correct.
■ Ensure that the Microsoft Dynamics AX user has permissions on the computer that is running
the report server.

Create a new number sequence in ax 2012

Number Sequence Creation:
Here I want to design a form named FirstForm with DataSource FirstTable
I want to create sequence  like "AX00001---------AX99999".
Step 1
Create an EDT - String Type
So, I created an EDT named "AXSeqEDT" with label "AX Seq"
Drag into Table(FirstTable)àFields
Step 2
Now create a new Number Sequence
Path for creating num Sequence is
"Module:: Organization administration.......Common.........Number sequences......Number sequences"
Click on New(Number Sequence)

Microsoft Dynamics AX 2012 Development Cookbook

Overview
  • Develop powerful, successful Dynamics AX projects with efficient X++ code with this book and eBook
  • Proven recipes that can be reused in numerous successful Dynamics AX projects
  • Covers general ledger, accounts payable, accounts receivable, project modules and general functionality of Dynamics AX
  • Step-by-step instructions and useful screenshots for easy learning
  • Numerous development tips and tricks for daily usage
  • This book is an update to Microsoft Dynamics AX 2009 Development Cookbook

Table of Contents

What makes a good Dynamics AX Project Manager?

The success and failure of Dynamics AX project is directly related to the quality of the project manager leading it. A recent survey of PWC showed that over 85% of dynamics ax project failed to achieve their core objectives – poor project management was one of the root causes.

to complete the post kindly click this link