Dynamics AX Blog - Posts from November 2018

These posts are machine-translated.
Currently, only posts from »November 2018« are displayed Filter entfernen

Reading the contents of an AXMODEL file

Microsoft Dynamics AX 2012 Management ShellIf you get a hotfix from Microsoft or a module from a Microsoft partner, you often only get one or more AXMODEL files. And there is often a great desire to know in advance which objects are affected by the import of this file.

Such information can be read with the Microsoft Dynamics AX 2012 Management Shell:

Get-AXModel -File 'c:	empdynamicsax2012r3_cl4555332.axmodel' -Details

Here's how it looks:

Manifest                   Summary                    Elements
--------                   -------                    --------
Microsoft.Dynamics.AX.F... {Classes: 3}              {ClassesWHSLoadLineI...

 
 
 

Create cost center by code

If you are ever embarrassed to have to create a cost center by code, this job may serve as inspiration:

static void createCostCenter(Args _args)
{
    str 30 _costCenter = "0815"; // Cost center id to create

    OMOperatingUnit omOperatingUnit;
    NumberSeqFormHandler numberSeqFormHandler;
    NumberSeq numberSeq;

    if (_costCenter)
    {
        if (!OMOperatingUnit::findName(
            _costCenter, OMOperatingUnitType::OMCostCenter))
        {
            ttsbegin;
            numberSeq = NumberSeq::newGetNumFromId(
                OMOperatingUnit::getNumberSequenceReference().NumberSequenceId);

            omOperatingUnit.clear();

            omOperatingUnit.initValue();
            omOperatingUnit.omOperatingUnitNumber = numberSeq.num();
            omOperatingUnit.Name = _costCenter;    // Id used as name
            omOperatingUnit.NameAlias = _costCenter;
            omOperatingUnit.omOperatingUnitType = OMOperatingUnitType::OMCostCenter;
            omOperatingUnit.LanguageId = CompanyInfo::languageId();

            if (omOperatingUnit.validateWrite())
            {
                omOperatingUnit.insert();
            }
            ttscommit;
        }
    }
}

 
 
 

 

 
 
 
Posts of the actual month
November 2018
MoTuWeThFrSaSu
 1234
567891011
12131415161718
19202122232425
2627282930 
 
© 2006-2024 Heinz Schweda | Imprint | Contact | German version | Mobile version
In order to provide you with better service, this site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.