Carsten M. Horl...'s profileMS Dynamics Ax and More ...BlogLists Tools Help

Blog


    July 04

    How to start a specific Batch Group during Startup

    Right now it is not possible to start a specific batch group with a startup command. You certainly can start the batch processing, but within the standard applications it is not possible to start one or more specific batch groups. The problem is caused by a missing parameter within the "SysStartupCmdBatchRun" class.
     
    Now we add a new method to this class:
     
    container CMHParmInCont()
    {
        container   conParm;
        int         i, j;
        str         parmString;
        ;
        conparm = conNull();
        for (i = 1; i <= strlen(parm); i = j + 1)
        {
            j = strscan(parm, ',', i, strlen(parm));
            if (j > 0)
            {
                parmString = substr(parm, i, j-i);
            }
            else
            {
                parmString = substr(parm, i, strlen(parm) -i +1);
                j = i + strlen(parmString);
            }
            conParm += parmString;
        }
        return  conParm;
    }
     
    This method extracts the given batchgroupids from the startup command.
     
    The second and last step is to modify the existing infoRun() method in a way that it starts the different batch jobs:
     
    void infoRun()
    {
        batchRun        batchRun = new batchRun();
        BatchGroupId    groupId;
        container       conParm;
        int             i;
        ;
        batchRun.parmUseForm(true);
        if (parm)
        {
            parm    = strrem(parm, ' ');
            conParm = this.KBSParmInCont();
            for (i = 1; i <= conlen(conParm); i++)
            {
                groupId = conpeek(conParm,i);
                batchRun.parmGroupId(groupId);
                if (batchRun.validate())
                {
                    batchRun.run();
                }
            }
        }
        else
        {
            batchRun.run();
        }
    }
     
    Thats´s all and have some fun!

    Comments (4)

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Nov. 3
    Sept. 5
    No namewrote:

    Hi,Do you need advertisement screens, LCD digital signage and LCD signages? Please go Here:www.amberdigital.com.hk(Amberdigital).we have explored and developed the international market with professionalism. We have built a widespread marketing network, and set up a capable management team dedicated to provide beyond-expectation services to our customers.

    amberdigital Contact Us

    E-mail:sstar@netvigator.com
    website:www.amberdigital.com.hk
    alibaba:amberdigital.en.alibaba.com[gddie

    Aug. 30
    Cyrus Bhardawrote:
    G'Day,

    Just wondering why you had to change so much? I followed the following guide:

    http://axaptabuilder.blogspot.com/2006/04/how-to-setup-axapta-batch-server.html

    And it worked perfectly, with minimal code editing.

    Just wondering why you changed so much?


    Oct. 2

    Trackbacks

    The trackback URL for this entry is:
    http://dynamicsandmore.spaces.live.com/blog/cns!763444E3F18A4CB0!305.trak
    Weblogs that reference this entry
    • None