Pages

Wednesday, April 30, 2014

Discarding merge of a changeset in TFS

On a project I work on, we have just had the first branch of my life. The merge features in TFS helps me merge needed changes between the two branches and it works just perfect.

As part of the branch I have had to assign a particular range for label id's in one of the branches. This is to avoid conflicts when merging the label files. You set up the label id range from Version Control / System settings / General. Changing this, triggers a change to VCSDef.xml which is also under version in TFS.

This is obviously not a change that I'd ever want to merge. Fortunately there is a way to tell TFS to discard the change when suggesting what to merge. There is no UI for the command, so open a Visual Studio command prompt from the workspace folder to use and enter the following:

tf merge /discard /version:C1134 /recursive SourceBranchName TargetBranchName

This also triggers a change, so you must check that change in. And that's it. The changeset is not suggested for merge between these branches again.

Monday, April 28, 2014

AX Configuration Store

AX uses the registry on the local computer of the client when it needs to know information about how the client is configured.

To set this up for each user has been quite tedious and often we have just created axc files with the configuration and put it on a file share. The problem with that approach is that neither AX itself or other applications have any means to figure out details of the client configuration. Two examples of applications that would benefit of knowing this is Visual Studio and MS Project.

In AX 2012 the configuration tool is extended with a bridge between the two methods of pointing to the configuration. This is called Configuration Store and with this you point out the axc file on the share, in the client configuration utility. So AX and other applications still knows about the active configuration through the registry, but you only need to apply configuration changes to the axc file on the file share.


Read more about the possibilities for shared client configurations here on TechNet: http://technet.microsoft.com/en-us/library/hh378075.aspx

This may be old news if you work a lot with AX installations, but it was new to me and I hope I wasn't the last to know.

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.