April 15, 2013

How to deploy all AX2012 report

Deploy all AX2012 report

We have 3 different ways to deploy Dynamics AX2012 reports:
  1. Through AOT
    AOT > SSRS Reports > Reports > right click on report > Deploy Element
  2. Through Visual Studio
    Open the report project > Right click on the project or solution node > Deploy
  3. Through PowerShell
    Publish-AXReport -ReportName *
Through AOT
- Go to AOT > SSRS Reports > Reports > right click > Deploy Element





Through Visual Studio
- Open your AX/Report project
- Right click on the project or solution node
- Click "Deploy"




Through PowerShell
- Go to: Start > Administrative Tools > Microsoft Dynamics AX 2012 Management Shell
- Then enter Publish-AXReport -ReportName *

For Complete post follow below link...

http://mybhat.blogspot.in/2011/10/how-to-deploy-all-ax2012-report.html.

-Harry

April 10, 2013

Container and unbounded string (text) fields are not allowed in a WHERE expression in AX.

Container and unbounded string (text) fields are not allowed in a WHERE expression in AX.

Error: Container and unbounded string (text) fields are not allowed in a WHERE expression in AX.

Reason: Axapta does not allow you to use an unbounded string in a where clause.

cont

Solution:

You must use a ‘bounded’ string. To do this you must declare your string with a numerical limiter e.g. str 50.


Example:

PurchTable getFirstByCustomerPOId(str 50 customerPOId)
{
PurchTable purchTable;
;
purchTable.selectForUpdate(true);
select firstonly purchTable
where purchTable.My_CustomerPurchaseOrderId == customerPOId;
return purchTable;
}


-Harry

April 08, 2013

Create a From through X++ Job

Hi,
Here is small code for create a AX From through X++ Job code.

static void theaxapta_formJob(Args _args)
{
    Form                    form;
    FormRun                 formRun;
    Args                    args;
    FormBuildDesign         formBuildDesign;
    FormBuildControl        formBuildControl;
    FormBuildTabControl     formBuildTabControl;
    FormBuildTabPageControl formBuildTabPageControl;
    FormBuildGridControl    formBuildGridControl;
    FormBuildDatasource     formBuildDatasource;
    FormBuildStringControl  formString;
    ;
    form = new Form();
    formBuildDatasource     = form.addDataSource(tableStr(PurchTable)); // Main Data Source for FORM
    formBuildDesign         = form.addDesign('design');// Add design in FORM
    formBuildTabControl     = formBuildDesign.addControl(FormControlType::Tab, 'Tab');
    formBuildDesign.height(1000);
    formBuildDesign.width(1000);
    formBuildTabPageControl = formBuildTabControl.addControl(FormControlType::TabPage, 'TabPage');
    formBuildTabControl.height(500);
    formBuildTabControl.width(500);

    formBuildGridControl    = formBuildTabPageControl.addControl(FormControlType::Grid, 'Grid');
    formBuildTabPageControl.height(500);
    formBuildTabPageControl.width(100);

    formString              = formBuildGridControl.addDataField(formBuildDatasource.id(), fieldNum(PurchTable, PurchId));
    formString.label("Purchase Order Form");

    args    = new Args();
    args.object(form);
    formRun = classFactory.formRunClass(args);
    formRun.init();
    formRun.run();
    formRun.wait();
}


-Harry