Latest Post

April 02, 2018

How To Set Session Time Limits Windows Server 2008

|0 comments
In Windows Server 2008, you can set remote user disconnect from his session or logoff from this session automatically. This is the way :
1. Open Local Group Policy Editor. You can open it using Run and type gpedit.msc then press Enter key.
2. Set the policy here Local Computer Policy > User ConfigurationAdministrative Templates > Windows Component > Terminal Services > Terminal Server > Session Time Limits
3. Set time limit
4. To take effect, you must restart your server

May 17, 2016

Using Method jumpRef On AX 2012

|0 comments
This is example use of method jumRef in AX 2012. This method can override from datasource field in a form. This code below describes the using of this method on "InventJournalTable" :

public void jumpRef()
{
    Args                    args = new Args();
    InventJournalTable      inventJournalTable;
    ;
   
    InventJournalTable = InventJournalTable::find("IJ-1605-0364");
    args.caller(this);
    args.record(inventJournalTable);

    new MenuFunction(menuitemdisplaystr(InventJournalTableMovement),
                     MenuItemType::Display).run(args);
}

August 20, 2015

Computed Columns in View Microsoft Dynamics AX 2012 Part 2

|0 comments
From Part 1, there is 2 column is Computed Column., CalculatedReal and ItemName. On part 1 was described how to create field CalculatedReal and on this part will be described how to make field ItemName.

We will create computed column to show Name alias(Search name) on view CPTransView.


At first, create a method with named compColItemName with detail code like below

public static server str compColItemName()
{
    #define.ViewName("CPTransView")
    #define.DataSourceName("CustPackingSlipTrans")
    #define.FieldItemId("ItemId")

    str         sItem, translationSQL, ret;
    DictView    dictView;
    ;

    dictView = new DictView(tableNum(#ViewName));

    sItem = dictView.computedColumnString
            (#DataSourceName,
             #FieldItemId,
             FieldNameGenerationMode::FieldList,
             true);

    translationSQL = strFmt("SELECT NameAlias FROM InventTable WHERE InventTable.ItemId = %1 AND DataAreaId = '%2'",
                     sItem, CompanyInfo::find().dataArea);


    ret = strFmt("%1", translationSQL);

    return ret;
}


that methode return field NameAlias on InventTable.

After it, right click on node Fields on  CPTransView and then select New->StringComputed Column


then, set properties of that new field like a picture below


If all finished, try to open the view


Computed Columns in View Microsoft Dynamics AX 2012 Part 1

|1 comments
Computed columns in view is a very useful feature in Microsoft Dynamics AX 2012. To understand it, let me show an example

I have a query named CPTransQuery with structure like a picture below

 From that query, I create a view named CPTransView with structure like a picture below

Let's see 2 field with name CalculatedReal and ItemName is a calculated field


How to make it ?
At first, create a method with named getCalculated() with detail code like below

public static server str getCalculated()
{
    return  SysComputedColumn::multiply(
            SysComputedColumn::divide(
                              SysComputedColumn::returnField(tableStr(CPTransView),
            identifierStr(CustPackingSlipTrans),
            fieldStr(CustPackingSlipTrans,Qty)),
            SysComputedColumn::returnField(tableStr(CPTransView),
            identifierStr(InventTrans),
            fieldStr(InventTrans,Qty)) ),
            SysComputedColumn::returnField(tableStr(CPTransView),
            identifierStr(CustPackingSlipTrans),
            fieldStr(CustPackingSlipTrans,ValueMST)) )
            ;
}

that methode calculated :
(CustPackingSlipTrans.Qty / InventTrans.Qty * CustPackingSlipTrans.ValueMST

After it, right click on node Fields on  CPTransView and then select New->Real Computed Column



 Set properties of new field like a picture before. If you have finished all step, let's try to open view :

August 12, 2015

Format Date Time On SSRS Report

|0 comments
On SSRS server, format standart for DateTime was adapted from Computer Setting. If we want to change this format, we must use an expression Format(Date, "StringFormat") like picture below