Wednesday 24 December 2014

One method to convert any data type to String.

In AX, you can use the "strFmt" method. This method can convert any data type to string. There is no need to write separate methods for each data type if you want to convert them to string.


Here is some sample code. I have declared and initialized some default AX data types. These data types are converted to string, which is printed in the info log.

    int i;
    real r;
    date dt;
    CustomerTransactionType cct; //AX base enum
    
    i = 10;
    r = 5.5;
    dt = today();
    cct = CustomerTransactionType::FreeTextInvoice;
    
    
    info(strFmt('%1',i));
    info(strFmt('%1',r));
    info(strFmt('%1',dt));
    info(strFmt('%1',cct));

1 comment:

  1. JackpotCity Casino - Blackjack, Slots, Roulette
    JackpotCity Casino is 당진 출장샵 the only licensed and regulated gambling operator in Canada 익산 출장안마 with over 전라북도 출장마사지 20 군포 출장안마 years of experience in the 창원 출장샵 regulated industry.

    ReplyDelete