Translate

Thursday, August 16, 2012

Convert/Upgrade MorphX Report to SSRS in Dynamics AX

Hi,

Convert/Upgrade MorphX Report to SSRS in Dynamics AX. Please follow the link

http://dynamicspost.blogspot.com/2012/04/convertupgrade-morphx-report-to-ssrs-in.html

:)

Friday, July 13, 2012

AX2012- Error executing code: object does not have method construct

HI,

When working with AX 2012 outbound document service, I faced this issue.
When I clicked the send electronically button on my custom created form, then the I could see the message is queued in queue manager form. On running of the batch I could see status as error with description "Error executing code: <empty class> object does not have method construct".

Solution:

You need to be few things to fix this error. the issue is due to compilation error where the particular method is not found while run time. So perform the following steps.

First, compile all the objects pertaining to a AIF document service.
Secondly, compile the base class - AxInternalBase
At last, select your project node and "Generate incremental CIL".


this will fix this error.



Thanks,
Prasan

Tuesday, July 10, 2012

Creating single field as Primary key in AX 2012

Hi Everyone, Hope you all doing well. I have come with the steps of creating the  single field as primary in AX 2012.

1) Create the Table and add required fields to the table as you all knows.
2) Create an Index by dragging the required field to the Index.
3) Set the following Index properties:
        a) AllowDuplicates to "NO".
        b) Alternate key to "YES".
4) Set the  PrimaryIndex  property of the table to newly created index after creating the Index. 

All The Best... :)

Please comment me your suggestions for my posts..

Saturday, February 25, 2012

Initialize the query in the report

We will assume the table as AssetTable( where the report is based on AssetTable), then write the code in init() method as
public void init()
{
    if(this.args().dataset() == TableNum(AssetTable))
    {
        AssetTable = this.args().record();
    }
    super();
}

Write the InitQuery() to initialize the query which is as follows..

public Query initQuery(Query _query)
{
    QueryBuildRange range;
    ;
    query = _query;
    if (AssetTable)
    {
        range = query.dataSourceTable(tablenum(AssetTable)).findRange(fieldnum(AssetTable,AssetId));
        if (!range)
            range = query.dataSourceTable(tablenum(AssetTable)).addRange(fieldnum(AssetTable,AssetId));
        range.value(AssetTable.AssetId);

or

SysQuery::findOrCreateRange(query.dataSourceTable(tablenum(AssetTable)), fieldnum(AssetTable, Assetid)).value(queryvalue(AssetTable.AssetId));
    }
    return query;
}

Now fi you call this specified report from the form which is based on Asset Table, then the report will run for specific Asset number.

// To avoid the usage data when called from Fixed Assets form(This will stop the usage data updates)
public boolean mustLoadSaveQuery()
{
    if (AssetTable)
    {
        return false;
    }
    else
    {
        return true;
    }
}
Thanks, and hope It will helps you.

Monday, February 13, 2012

How to identify the Table associted with called map

<MapName>.TableId == TableNum(TableName) will be able to identify the table which is called to this map.
Ex: In addressmap, there are so many tables mapped, but to update the address only one table is called at a time like CustTable, So to identify whether it is called from custTable, then

we write code as
if(AddressMap.TableId == TableNum(CustTable))
{
info("Cust Table is called to map");
}
else
{
info("Other than custTable, the map is called");
}