vendredi 3 juin 2011

How to use batch in Dynamics AX

To make a batch in Dynamics AX you need to use runBaseBatch extended class and use this class a menuItem of type Action for example you have a button that called this menuItem  and passes a parameters 

void clicked()
{
    Args            args;

    MenuFunction    menuFunction;
    ;

    args = new args();

    menuFunction = new Menufunction(identifierstr(Thy_ForUpdateItemBatch), MenuItemType::Action);

    args.parm( InventItemGroup.ItemGroupId );

    menuFunction.run(args);


    super();

}

You runBaseBatch extended class

See this attached class

You can the parameter passed to the menuItem Action in the initFromArgs method of the class.

void initFromArgs(Args _args)
{
    ;
    if(_args.parm())
    {
        groupId  = _args.parm();
    }
    else
    {
        error("@SYS22539");
    }

}


http://www.2shared.com/file/-eL_PJm6/Class_Thy_ForUpdateItemBatch.html


Happy Daxing !

Aucun commentaire:

Enregistrer un commentaire