How long have you been using Microsoft Dynamics Ax?

Toplam Sayfa Görüntüleme Sayısı

Popular Posts

Translate

Bu Blogda Ara

27 Temmuz 2012 Cuma

Flush .Net Business Connector Cahce

Hi,

When you edit some method on class in AX and then use it on BC you will notice .Net code uses the old method.

You can restart IIS, AOS or both but this is not the best solution and not always solve our problem.
We just need to flush the AOD on AX side.
We will just write one line code to the .net application 
Microsoft.Dynamics.BusinessConnectorNet.Axapta.CallStaticClassMethod(“SysFlushAOD”, “doFlush”);
You can use this code after Axapta logon and just before calling the static method.
Hope it helps,
Have a nice AXing,
Alper.


26 Temmuz 2012 Perşembe

List all tables on AX / Tüm tabloları listeleme

Hi,

If you need to list all tables on AX you need to call Global::pickTable method it will return tablenum after that you can do whatever you want.

Example :
    info(tableid2name(Global::pickTable()));

Happy AXing,
Alper.

/////////////////////////////////////

Merhaba,

AX üzerinde açılmış tüm tabloları listelemek istediğinizde yapmanız gereken tek şey Global sınıfının altındaki pickTable methodunu çağırmak. Bu method seçilen tablo adının id sini size geri dönüyor. Geri dönüş değerini aldıktan sonra istediğiniz gibi değeri kullanabilirsiniz.

Örnek
    info(tableid2name(Global::pickTable()));

Bol AX lı günler,
Alper.

24 Temmuz 2012 Salı

Coloring grid lines or cells from code / Grid alan veya satırlarını kod ile renklendirme

Hi,

We can color up grid lines by using displayOption. On forms datasource expand methods click right mouse ,select overwirte function and select displayOption.

For code example open tuttorial_Form_displayOptions form


public void displayOption(Common _common, FormRowDisplayOption _options)
{
    // here's the logic which derteminates the color for this row
    // In this case it will random color the lines
    if (_common.recId mod 3 ==0)
    {
        _options.backColor( WinAPI::RGB2int( 255,0,0 ));
    }
    super(_common,_options);
}

With this code example if recId's mod  is equal to 3 it will paint the entire row to red. But if we want to paint only one cell individually we will use

_options.affectedElementsByControl(CustTable_Name.id());

As you can see we used affectedElementsByControl method to paint only sellected control.


Happy Axing.
Alper.


////////////////////////////////////////////////////////////////////


Merhabalar,

Form üzerindeki gridlerde istenilen koşula göre renklendirme yapmak istediğimizde form veri kaynağı üzerinde bulunan displayOption methodunu ezeceğiz.

Methodu ezmek için form un altında yer alan veri kaynağının methodlarını genişletip yöntemi geçersiz kıl ı seçtikten sonra açılan listeden displayOption ı seçiyoruz.

Örnek kod olarak  tuttorial_Form_displayOptions formunu kullabiliriz.


public void displayOption(Common _common, FormRowDisplayOption _options)
{
    // here's the logic which derteminates the color for this row
    // In this case it will random color the lines
    if (_common.recId mod 3 ==0)
    {
        _options.backColor( WinAPI::RGB2int( 255,0,0 ));
    }
    super(_common,_options);
}

Bu örnekte custtable ın RecId alanının değerinin mod 3 e göre değeri 0 olduğunda kayıdın bulunduğu satırı tümüyle kırmızıya boyuyor.

Eğer tüm satırı değilde sadece tek bir alanı boyamak istersek koda alttaki satırı eklememiz yeterli.

_options.affectedElementsByControl(CustTable_Name.id());

Bu şekilde affectedElementsByControl methodunu çağırarak boyama işleminin sadece parametre olarak gönderdiğimiz  CustTable_Name.id() konrolü için geçerli olduğunu belirtiyoruz.


Mutlu AXlar,


Alper.