November 24, 2012

How to go to the object from Infolog

How to go to the object from Infolog

When we print a transaction id through infolog Usually, it is more useful if the user can go directly to the object from an Infolog line.

For example, we need to see all the BOM without any active version. By the way, this is a good example, too, for what we cannot do by means of Advanced Filter but quickly by coding a short job.


static void SIBOMwithNoActiveVersion(Args _args)
{
    BOMTable    bomTable;
    BOMVersion  bomVersion;
    int         nmbr, i;
    boolean     printOnly = false;
    ;

    SetPrefix('BOMs without any active version');
    Nmbr = 0;

    while select bomTable
    notexists join bomVersion
    where bomVersion.Active == NoYes::Yes
    && bomVersion.BOMId == bomTable.BOMId
    {
        nmbr++;
        info(strfmt("%1 %2, %3, %4, %5, %6, %7",
                                          nmbr,
                                          bomTable.BOMId,
                                          bomTable.Name,
                                          bomVersion.ItemId,
                                          bomVersion.Name,
                                          bomVersion.Active
                                          ),"",
        SysInfoAction_TableField::newBufferField(bomTable, fieldnum(bomTable, BOMId)));

    }

}

Now the user can opt for Show from the context menu or just double-click on the interesting line to open the related form.







-Harry

November 16, 2012

Opening the table from x++ code

Opening the table from x++ code

This code helps you to open the any Table from X++ code. Here is an example for SalesTable, just copy and paste this into a job you will get the table.

static void TableBrowser(Args _args)
{
SysTableBrowser sysTableBrowser = new SysTableBrowser();
;
//Browse the SalesTable table
sysTableBrowser.run(tablenum(SalesTable ));
}

How to run Client Batches on AX 2009

How to run Client Batches on AX 2009

In AX 2009 the batch engine has been changed to run as a service.
The batch services do only process server batches they don't process client batches aynmore.

There might still be some situations where you would like to run client batches.
The following description explains how to do this.

  • Create a new batch group 'Client' which is used for client batches later.
    (Administration -> Setup -> Batch groups)
  • Add this batch group to an AOS acting as batch server.
    (Administration -> Setup -> Server configuration)
    This is needed to change the status from 'Waiting' to 'Ready' on the batch tasks and to 'Execute' on the batch jobs.
    The batch server will not process any client batches.
  • Start the legacy batch client
    (Basic -> Periodic -> Batch -> Processing)
  • Select the new created batch group 'Client' and press 'OK'
The client batch server will now process all client batches of the 'Client' batch group.
-Harry

November 10, 2012

Designate a batch server


Designate a batch server

A batch server is an Application Object Server (AOS) instance that processes batch jobs. Batch jobs are used to run tasks, such as printing reports or posting journals, at a specified time and probably on a different computer.
The first AOS to be set up is automatically designated as a batch server. Use multiple batch servers to increase throughput and reduce the amount of time it takes to run batches.

When you set up a batch server, you can specify the times that it is available for batch processing. We recommend excluding a server from batch processing when it is busy with regular transaction processing. For example, you may have servers in different time zones. You can set server schedules so that each AOS is available for user traffic during the day and for batch traffic overnight.

For more information about batches, 
see the Applications and Business Processes Help, 
available from the Microsoft Dynamics AX Help menu. 

1. Click Administration > Setup > Server configuration.

2. Press CTRL+N to add a new batch server.

3. On the Overview tab, enter a server ID in the following format: InstanceName@ServerName.

4. Select Is Batch Server to enable batch processing on the server. 

5. On the Batch server schedule tab, enter the maximum number of batch tasks that can be run on the AOS instance at one time. The server will continue to pick up tasks from the queue until it reaches its maximum.

6. To specify when the server is available for batch processing, enter a starting time in the Start time field and an ending time in the End time field. Press CTRL+N to enter an additional time period.
Note: If the server is running a task when its batch processing availability ends, the task will continue running to completion. However, the server will not pick up any more tasks from the queue.

7. On the Batch server groups tab, use the arrow buttons to specify the batch groups that can run on the selected server. Batch groups are used to direct batch tasks to specific servers.

- Harry