Dynamics AX Blog - Posts from November 2016

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

Merge two maps into one

Recently, I wanted to merge two maps into one, but I did not find an appropriate function, so I wrote the following myself.

private Map mergeMaps(Map _map1, Map _map2)
{
    Map retMap;
    MapEnumerator mapEnum;
    // Initate first map from second map if empty
    if( !_map1)
    {
        _map1 = new Map(_map2.keyType(), _map2.valueType());
    }
    // Check compatibility
    if(_map1 && _map2)
    {
        if(_map1.keyType() != _map2.keyType() || _map1.valueType() != _map2.valueType())
        {
            throw error(Error::wrongUseOfFunction(funcName()));
        }
    }

    retMap = _map1;
    mapEnum = _map2.getEnumerator();
    while(mapEnum.moveNext())
    {
        if( !retMap.exists(mapEnum.currentKey()))
        {
            retMap.insert(mapEnum.currentKey(), mapEnum.currentValue());
        }
    }
    return retMap;
}

 
 
 

Use the PreviewPartRef property of a table

Preview partHave you ever wondered how Dynamics AX builds up this window for employees when moving the mouse over the name of an employee?

This is caused by the PreviewPartRef property of a table, which allows you to quickly create preview windows.

The following steps are necessary:

  • Create a form
  • Create a form part, which points to above form
  • Create a (Display-)Menu item which points to the form part
  • Enter the name of the menu item in the poperty PreviewPartRef of the table

For example, I created a simple form for the CustGroup table and included it as described above.

Enhanced preview part

Without my customization, the preview usually looks as follows:

Original previw part
 


 
 
 

 

 
 
 
Posts of the actual month
November 2016
MoTuWeThFrSaSu
 123456
78910111213
14151617181920
21222324252627
282930 
 
© 2006-2025 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.