Wednesday, December 21, 2011

ChangeCompany: common.company() vs. common.dataAreaId

When you use the changeCompany(...) functionality and the company should be retrieved by a record's company you should always use

changeCompany(common.company())
{
    // do something in the specific company
}
instead of

changeCompany(common.dataAreaId)
{
    // do something in the specific company
}

Why? Because the dataAreaId can contain a virtual company aswell as a normal company, and if you try to do changeCompany(virtualCompany), this will interrupt with a runtime error. But the company() property returns always the selectable company which can properly used in a changeCompany(...) statement.

This works also with table views and crosscompany selections:

while select crosscompany:['Company1', 'Company2'] common
{
    changeCompany(common.company())
    {
        // do something in the specific company       
    }
}

By the way, probably unknown to much people, this company(...) property can be used before data modification to dictate operation company:

    // current company is Company1
    common.company('Company2');
    select firstonly common; // this will return the first row in Company2 even you are in Company1!

I think, this can minimize the use of changeCompany(...) if used wisely.

Tuesday, June 14, 2011

Change your Windows 7 into the Dynamics OS

Hi there

However, this time a funny post. Have you ever considered to change the Windows 7 Start Button (the blinky orb on the left in the task pane)? Since it is just a ressource in explorer.exe, it is quite easy to do.

  1. Download the 'Windows 7 button changer' from here:  http://luegisdorf.ch/w7btnChange2.6.exe (of course you can find it elsewere on the web too)
  2. Download the 'Dynamics Orb' from here: http://luegisdorf.ch/AX/6801_dynamics.bmp
  3. Make sure, your user has local administrator rights for the current machine
  4. Change properties for explorer.exe in (...\Windows\explorer.exe) as follow:
    1. Change owner to your account (security, advanced, owner)
    2. Change security settings to allow full access for current user
  5. Open the 'Windows 7 Button Changer' application, select the the downloaded bitmap file
  6. Revert settings for explorer.exe (remove rights, reset owner)
  7. Enjoy your new Dynamics OS!
And that's how it looks:
Idle

Hover


Pressed










Of course, you need to run the ''visual style", not the "classic style" ...