Tuesday, April 15, 2014

Limit memory consumption of SharePoint 2013's Search process

On my different developer boxes and the demo images I use as sandboxes, I have the problem that SharePoint's Search process has a tendency to hog all available memory.

Today I took the time to try to figure out what to do about it, and I came across this article which actually helped.

I already had the Reduced level of performance, but changing the configuration file to allow it to use a smaller amount of memory helped.

Wednesday, April 9, 2014

A bit of code for creating a worker in AX 2012

private HcmPersonnelNumberId nextPersonnelNumberId()
{
    HcmPersonnelNumberId    hcmPersonnelNumberId;
    NumberSequenceReference numberSeqReferencePersonnelNum;
    NumberSequenceTable     numberSeqTablePersonnelNum;
    NumberSeq               numberSeqPersonnelNum;

    // Number Sequence
    numberSeqReferencePersonnelNum  = NumberSeqReference::findReference(extendedTypeNum(HcmPersonnelNumberId));
    numberSeqTablePersonnelNum      = NumberSequenceTable::find(numberSeqReferencePersonnelNum.NumberSequenceId);

    if (numberSeqTablePersonnelNum)
    {
        // generate worker personnel number if number sequence code is created.
        numberSeqPersonnelNum = NumberSeq::newGetNumFromId(numberSeqTablePersonnelNum.RecId, true, true);

        if(numberSeqPersonnelNum)
        {
            hcmPersonnelNumberId = numberSeqPersonnelNum.num();
        }
    }
    return hcmPersonnelNumberId;
}

private void createHCMWorker()
{
    AxDirPerson             person;
    AxDirPersonName         personName;
    HcmWorker               worker;
    HcmPersonnelNumberId    hcmPersonnelNumberId;

    hcmPersonnelNumberId = this.nextPersonnelNumberId();

    if (!hcmPersonnelNumberId)
        return;

    // Create a person
    person = AxDirPerson::construct();
    person.parmName("Santa Claus");
    person.save();

    personName = AxDirPersonName::construct();
    personName.parmPerson(person.dirPerson().RecId);
    personName.parmFirstName(person.dirPerson().Name);
    personName.parmValidTo(DateTimeUtil::maxValue());
    personName.save();

    // Create the worker
    HcmWorkerTransition::newCreateHcmWorker(personName.dirPersonName(), hcmPersonnelNumberId);
}

Monday, April 7, 2014

How to make a ZIP file from AX 2012 R2 CU7

If you need to create ZIP files from AX you can now look at the class SysTaskRecorderPackageZip to see how that is done. This is a new class included in CU7 (KB2885603) or the earlier hotfix from KB2863182.

Wednesday, March 5, 2014

Announcing new book: Microsoft Dynamics AX 2012 R2 Services

A new version of the "Microsoft Dynamics AX 2012 R2 Services" book is due to be published.

Read more, and enter the contest for a chance to win a copy, here: http://www.artofcreation.be/2014/03/04/announcing-new-book-microsoft-dynamics-ax-2012-r2-services/

Friday, February 28, 2014

Improvements to Issue Search on Lifecycle Services

Issue Search now not only supports search by string or KB but also supports search by AOT object path and AOT object element.
  • To search for an AOT object path, use the format “$\ObjectType\Object”. For example $\Classes\Tax.
  • To search for an AOT object element, use the format “$ObjectType\Object#Element”. For example $\Classes\Tax#post.

Thursday, February 27, 2014

Beware when using SqlDictionary for reflection in AX

I stumbled across this little quirk today, in AX 2012 R2. 

If you use SqlDictionary for reflection on tables, you'll miss all tables that are extended from another table. These tables are not in SqlDictionary by themselves, the fields are listed with the parent table. So SqlDictionary reflects how the table(s) are created on SQL Server and not how they are modelled in the AOT.