Showing posts with label Functions in Ax 2012. Show all posts
Showing posts with label Functions in Ax 2012. Show all posts

Monday, 18 January 2016

Functions in Ax 2012

static void CON_functions(Args _args)
{
    int             i;
    real            r;
    str             s;
    container       con;
    date            d;
   // AifDocumentCreateAttribute
    //i = 1<<4;
    //i = 1>>4;
    //i = (100>101)?1:5;

    //i = abs(10*20.69544);    abs        Retrieves the absolute value of a real number.
    // i = acos(180);          acos       Retrieves the arc cosine of a real number.

    // i = 42373;
    //mydate = any2date(i);                                     any2date

    //s = 1;
    //st = any2enum(s);                                         any2enum
   // x = any2int(s);                                           any2int
   // x = any2int64(s);                                         any2int64
   // x = any2real(s);                                          any2real
   // x = any2str(s);                                           any2str
   // i = asin(1.2);                                            asin
   // i = atan(1/0);                                            atan
   // x = attributeStr(AifDocumentCreateAttribute);             attributeStr
   // beep();                                                   beep
   // x = char2num("RaJendra",1);                               char2num
   // x = classIdGet(obj);                                      classIdGet
   // x = classStr(Global);                                     classStr

                            //Container
    //con = ["Rajendra","chilukuri","410",9440078438];
    //info(strfmt("%1",conPeek(con,5)));                        conPeek
    //con = conPoke(con,2,"Chilukuri's");
    //info(strfmt("%1",conPeek(con,2)));                        conPoke
    //s = conLen(con);
    //info(strfmt("%1",s));                                     conLen
    //con = conIns(con,5,"Hello How are You ??????");
    //info(strFmt("%1",conPeek(con,5)));                        conIns
    //info(strFmt("%1",conFind(con,"410")));                    conFind
    //con = conNull();
    //info(strFmt("%1",conPeek(con,1)));                        conNull
    //con = conDel(con,1,1);
    //info(strFmt("%1" ,conPeek(con,1)));                      // conDel

    //i = corrflagset(0.369,2);

    //i = cos(900);             cos         Retrieves the cosine of a real number.

    //i = cosh(0);              cosh        Argument values outside of the range –250 to 250 result in the following run-time error: "Argument for trigonometric function out of range."

    //i = cTerm(10,100,50);     cTerm       Calculates the number of periods required for the current investment value to yield a target value.

    //x = curext();             curext      Retrieves the extension that is used for the current company.

    //x = curUserId();          curUserId   Retrieves the nonnumeric ID that represents the current user.

    //x = datasetStr(CustomerList);  datasetStr           Retrieves the name of a dataset as a string.
    //d = today();
   // s = date2num(d);          date2num    Converts a date to an integer that corresponds to the number of days since 1 January, 1900.
   // date2Str                  Converts the specified date to a string.


    //utcDateTime         utc2 = 1959-06-17T15:44:33;
    //x = datetime2str(utc2);
    //formStr                   Retrieves the name of a form.

    // i = frac(1.3658);        Retrieves the decimal part of a real number.


    //info(strFmt("%1",funcName())); //Retrieves a string that contains the current function context.  o/p con_functions
    //setPrefix("Hai");
    //setPrefix("Hello");           Retrieves the current execution prefix after successive calls to the setPrefix function.
    //setPrefix("Namaskaram");
    //setPrefix("Whole Ax Team");

    //info(getPrefix());

    //date refDate = str2Date("4/9/2007", 213);
    //date inputDate = str2Date("10/5/2007", 213);
    //int numberOfIntervals;
    //;
    //numberOfIntervals = intvMax(inputDate, refDate, intvScale::YearMonth);
    //info(strFmt("%1",numberOfIntervals));

    //i = logn(100);            Retrieves the natural logarithm of the specified real number.

    //s = match("<abc","abcdef");       Searches for a string or expression within another string.

    //s = min(12,15,19);
    //d = maxDate();            Retrieves the maximum value allowed for a variable of type date.
    //i   = maxInt();

    //x = methodStr(Calculator,exponent);   Validates that the specified method exists in the specified class; if not, a compiler error occurs.

    //d = mkDate(11,1,2016);      Creates a date based on three integers, which indicate the day, month, and year, respectively.

    //str x1 =mthName(1);           Retrieves the name of the specified month

    //s = mthOfYr(today());

    //d = prevyr(today());

    //x = num2char(67);             Converts an integer to the corresponding ASCII character.

    //d = num2date(364);             // Retrieves the date that corresponds to the specified number of days after 01\01\1900.

    //s = power(5,2);

    //i = round(15,4.00);
    //info(strFmt("%1",sessionId()));
    //int seconds = 10;
    //int i1;
    //i = sleep(60);

    //d = str2Date("31/02/2010",213);

    //s = strAlpha("?a*bc123.");        Copies only the alphanumeric characters from a string.

    //i = strCmp("Raj","Raj");

    //strColSeq                         Converts all uppercase characters to lowercase characters and converts all characters with accents to the corresponding unaccented lowercase characters.


    //info(strFmt("%1", strDel("abcdef",2,3)));  Creates a copy of a string with the specified substring removed.

    //info(strFmt("%1",strKeep("Hellohainamastehi","hai"))); returns str2 values based on str1

    //info(strFmt("%1",strRep("Rajendra ",3)));   Repeats a string of characters.
    //info(strFmt("%1",timeNow()));             The number of seconds that have elapsed since midnight.

    //r = trunc(3.12);
    //print strFmt("r = %1",  r);               Truncates a real number by removing any decimal places.

    //pause;

    //info(strFmt("%1",year(today())));         Retrieves the year from a date value.
    info(strFmt("%1",yearDiff(today(),today()-7)));
}