Tuesday, January 31, 2012

ReleaseUpdateScripts Table in AX 2009

Hi,
   In AX 2009 you can use the  ReleaseUpdateScripts table which contains all upgrade scripts to be scheduled for execution during the Data Upgrade process.

Following is the code to check the "garbase" in the ReleaseUpdateScripts table :


static void CheckGarbaseDemo(Args _s)
{
ReleaseUpdateScripts    releaseUpdateScripts;
Counter                 total;
Counter                 invalid;
;
while select ClassID
    from    releaseUpdateScripts
    group by ClassID
{
    total++;
    if (classid2name(releaseUpdateScripts.ClassID) == '')
    {
        info(int2str(releaseUpdateScripts.ClassID));
        invalid++;
    }
}
info(strfmt(@"Garbage Found %1 invalid classIds out of %2", invalid, total));
}

Get the Current Active Company in Dynamics AX.


Hi,

To get the Current Logged In Company you can Use the curExt() function in AX.

Example :

static void curExtExample(Args _arg)
{
str CompanyId;
;

CompanyId = curExt();
Info(CompanyId);
}



You would also get the same result with below code as well.

static void curExtExample(Args _arg)
{
str CompanyId;
;

CompanyId = CompanyInfo::Find().DataAreaId;
Info(CompanyId);
}


Enjoy DAX!!!

Update Labels in Dynamics AX 2009

Hi,

If you are an .aod (axCus.aod) and .ald (axCONen-us.ald) file Test Server to Production Server. Then, after the import you will restart the AOS (in Production Server) and you will found that the labels you created in Test Server will not be there in the Production Server.

To fix the problem you need to go to Production Server and delete the existing axCONen-us.ali file and restart the AOS again on this environment. After this operation your labels will get updated in the Production Server.

Enjoy DAX!!!

Validate Table from X++

Hi,
   From the below code you can easily validate a table field using X++ code.


static server boolean validateTable(common _common)
{
boolean ret = true;
SysDictTable    dictTable;
int fldCnt, i;
fieldId fid;
;


dictTable = new SysDictTable(_common.TableId);
fldcnt = dictTable.fieldCnt();
for(i = 1; i <= fldcnt; i++)
{
fid = dictTable.fieldCnt2Id(i);
ret = ret && _common.validateField(fid);
}
info(strfmt('Validation Result :%1',ret));
return ret;
}


Deploy SSRS Reports using Code in AX 2012


Following code can be used to deploy SSRS reports in Ax 2012.
However make sure that this code runs from the client, and not as CIL (otherwise you will get run time errors)
I can run this below code as a job and works fine.
Plz Note : This code will only work in AX 2012 as in AX 2009/4.0/3.0 there were no SSRSReport Classes.

static void deploySSRSReportDemo(Args _s)
{
SSRSReportManager mgr=new SSRSReportManager();
SSRSReportConceptNode node=new SSRSReportConceptNode();
;
node=TreeNode::findNode(@"\\SSRS Reports\Reports\SalesInvoice");
mgr.deploymentStart();
mgr.deployReport(node);
mgr.deploymentEnd();
}

Enjoy DAX!!!

Sunday, January 29, 2012

Dynamics AX Technical Consultant Interview Questions Series II

Hi,
   Hope you have enjoyed my Previous post for Dynamics AX Technical Interview Questions Series I
Please Find some more Technical Questions below :


  1. What’s new in Dynamics AX 2012
  2. OOPs concepts
  3. Definition of AOT elements
  4. Document Management and Print Management
  5. Visual Form & Report designer
  6. Unit test framework
  7. Reverse Engineering tool
  8. Version Control System in AX 2009
  9. Layers & their usage.
  10. Web Services concept
  11. AIF in Dynamics AX 2009
  12. AX 2009 Workflow configuration
  13. Dynamics AX security hierarchy
  14. AOS Load balancer concept/Clustering
  15. Differences Between :-
    1. AX 4.0 & AX 2009
    2. MorphX & Intellimorph
    3. RunBase & RunBaseBatch
    4. element & this
    5. COM & .NET Business Connector
    6. Concurrent user & Named user
    7. Primary key & Foreign key
    8. Construct & New methods
    9. VSS & TFS
    10. Table & View in AOT
    11. Auto design & Generated design in reports
    12. Business connector & External Connector
    13. Refresh(),reread(),research() & executeQuery()
    14. formDataSource.queryRun().query() & formDataSource.query()
    15. Normal, field fixed & related field fixed relations




Enjoy DAX !!!

Thursday, January 26, 2012

How to Create New Role Center in AX 2009


Create new role center in Dynamics Ax 2009

Compiled from Dynamics Ax Developer help for quick reference.
  1. Open Dynamics Ax enterprise portal (default installation is http://servername/sites/DynamcisAx).
  2. Click on Site Action > Create . Choose Web part page (as most Ax role center using this). Complete the page creation.
  3. Open Ax client > AOT > Web > Web menu item > URLs > New URL.
  4. Specify URL Properties by clicking on the elipsis button. Browse Enterprise portal folder and choose the .aspx page created in the step 2.
    If got error go to here.
  5. Set home page property to YES. (If not the page will not be available to be chosen as user profile role center page).
  6. Right click > Import. This will import the page to AOT under web > web files > page definitions.
  7. Locate the new page definition on step 6. Set the page title properties.
  8. Go to Admin > Setup > User profile. Create a new record. Choose the role center column from drop down.
  9. Click view role center button to test.
Enjoy DAX!!!