Wednesday 10 June 2015

Coping data from one table to another table


static void copy(args _args)
{
    SourceTable sourceTable;
    DestinationTable destinationTable;
    ttsbegin;
    while select sourceTable
    {
      buf2buf(sourceTable,destinationTable)
       destinationTable.insert();
     }
    ttscommit;
}

Tuesday 19 May 2015

Multiplication Table via user input in AX 2012

static void Table2(Args _args)
{
    int i,j,c,counter=1;
    Dialog d =new Dialog("Muliplication Tables");
    DialogField df1,df2;  
    df1=d.addField(extendedTypeStr(Num),"Enter the multiplier table to display");
    df2=d.addField(extendedTypeStr(Num),"Enter the multiplicant table to display");
 
   if(d.run())
       {
           i=any2int(df1.value());
           j=any2int(df2.value());
           while (counter<=j)
            {
                c=counter*i;
                counter++;
                info(strFmt("%1",c));
            }
        }
}