Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Tuesday, February 25, 2014

Container handling in Dynamic AX 2012

Hi,
static void HandlingContainerJob(Args _args)
{
    container contain;
    int i;
    str containstr;
    ;
    contain = ["DataAt1stPosition","DataAt2ndPosition"]; //Data will be inserted at position 1 and 2
    contain = Conins(contain,3,"DataAt3rdtPosition","DataAt4thPosition"); // from 3rd position onward
    contain = conins(contain,5,"DataAt5thPosition"); // now the data inserted in 5th position
    //or use this technique
 
    info (strFmt("Length of the container: %1", conLen(contain)));
    for (i=1; i <= conLen(contain); i++)
    {
        info (strFmt("container value %1 is %2", i, conPeek(contain, i)));
    }
    //containstr =  con2Str(contain);
    // use to pass from one form to another then again str2con() retrive in container format
    /*
        Condel - Use condel to delete one or more items from a container.
        Confind - Use confind to locate a sequence of items in a container.
        Conins - Use conins to insert some items into a container.
        Conlen - Use conlen to find out how many items there are in a container.
        Connull - Use connull to explicitly dispose of the contents of a container.
        Conpeek - Use conpeek to extract an item from a container, and to convert it into another data type, if necessary.
        Conpoke - Use conpoke to replace (poke) an item in a container.
    */
}

Regards

Monday, February 24, 2014

Often using CMD(Command prompt) code

Hi,

dir /s /b /o:gn

dir

XCOPY  C:\*.*  D:\NewFolder\   /S
//XCOPY makes the file copy from C: drive to D:\newFolder


192.168.0.162


dir  - list out directory list

dir *.exe
dir *.txt *.doc
dir /ad - List only the directories in the current directory.
dir /s - Lists the files in the directory that you are in and all sub directories after that directory,
dir /p - If the directory has a lot of files and you cannot read all the files as they scroll by - veritical
dir /w -  Horizontal view of dir
dir /s /w /p
dir /on - dir in sort by alphabet
dir /o-n - dir in reverece order
dir \ /s |find "i" |more - list all directories on the hard drive, one screen page at a time, and see the number of files in each directory and the amount of space each occupies.
dir > myfile.txt - Takes the output of dir and re-routes it to the file myfile.txt instead of outputting it to the screen.

Regards,

Get a table ID in SQL - D365

Hi select ID from SysTableIdView where  SysTableIdView .Name = 'CustTable' Regards,