Thursday, January 5, 2017

jQuery Popup




 







                       
                   

Tuesday, August 23, 2016

Dynamics AX - The value 1 is not found in the map

Issue Resolved. The problem was in the progress bar. The workaround is to use the SetTotal(someinteger) method instead of the incCount() method .

Monday, August 8, 2016

Ferranti DateTime Conversion to Date

Ferranti  DateTime Conversion to Date

IIF (b.bilstartdate = '0','0',CONVERT(VARCHAR(12),DATEADD(day, -2, (36526+(LEFT( b.bilstartdate + 288000000000,11)-63082281600)/(24*3600))),5) )as startdate

Thursday, August 4, 2016

Executing SQL Query in Dynamics AX

X++ language supports a number of ways to execute native SQL against any SQL data source.

Note: don't forget to set RunOn Property to Server of the class. Job:

static void BillingQuery(Args _args)
{
    RunSqlQuery q = new RunSqlQuery();
    q.RunSqlQueryMethod();

}

Class:

class RunSqlQuery
{
}

public void RunSqlQueryMethod()
{
     str sql;
    Connection conn;
    SqlStatementExecutePermission permission;
    Statement Stmt;
    ResultSet R;
    str result;
    ;
    sql = "select ACCOUNTNUM from custTable";

    conn = new Connection();
    permission = new SqlStatementExecutePermission(sql);
    permission.assert();

    Stmt = conn.createStatement();
    R = Stmt.executeQuery(sql);
    while ( R.next() )
    {
        result =  R.getString(1);
    }

    // the permissions needs to be reverted back to original condition.
    CodeAccessPermission::revertAssert();
}

Below the useful links.

http://blog.rahulsharma.in/2010/04/dynamics-ax-sqlstatementexecutepermissi.html

https://msdax.wordpress.com/2010/06/21/executing-sql-directly-from-x/

Wednesday, August 3, 2016

Time elapsed functions in AX 2012

The below links will have good examples of how to know time elapsed by a process in AX 2012,

This is needed sometime when you want to do some performance tuning of a method/ query.

Please refer the below links for more details

https://dynamicsaxgyan.wordpress.com/2012/01/12/timeconsumeda-very-useful-function-in-global-class-in-ax-2012-x/

https://ax-dynamics.com/three-ways-to-count-time-in-dynamics-ax-2012/

https://workflowax.wordpress.com/2009/10/01/timing-an-operation/