Setting Configurations – by simple Job run

 

Axapta – Configurations through X++ Code

Guys…fed up of setting up the configurations after installing AX..by checking and unchecking the modules..

Here is the small utility that saves your time if you want to use all the modules…

Usually we go to the Administration->SetUp->System->Confiuration and we configure the modules(check/uncheck)

 
Just run the job, it will configure the modules (remember the code which is commented is to just give u an example
how to configure a single module.This job will enable all the modules)and synchronise the tables as well.
 
If you want to configure specifically some modules , you can check the commented logic in the code below and customise accordingly.
 
static void changeSystemConfiguration(Args _args)
{
    ConfigurationKeySet     set;
    ConfigurationKeyId      id;
    SysDictConfigurationKey sysDictConfigurationKey;
    int     i;
    Args    args;
    FormRun formRun;
    ;
    set = new ConfigurationKeySet();
    for(i = 1; i <= set.cnt(); i++)
    {
        id = set.cnt2Id(i);
        sysDictConfigurationKey = new SysDictConfigurationKey(id);

        //if(sysDictConfigurationKey.label()== ‘Country-specific features’)
        //{
            set.enabled(id, true);
            sysDictConfigurationKey::save(set.pack());
        //}
    }
    // for opening System Configuration Form and synchronising the tables.
    args = new Args(formStr(SysConfiguration));
    formRun = classFactory.formRunClass(args);
    formRun.init();
    formRun.run();
    appl.dbSynchronize(0, false,true,true);
    formRun.wait();
}
 
Hurry…my configurations are done by just pressing F5
Advertisements

2 Responses to “Setting Configurations – by simple Job run”

  1. Elliott Says:

    Very shortly this site will be famous among all blog people,
    due to it’s good articles or reviews

  2. IT Support Blog Says:

    fantastic publish, very informative. I’m wondering why the opposite experts of this sector don’t notice this.
    You must proceed your writing. I am sure, you have a
    huge readers’ base already!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: