Thursday, December 20, 2018

call directly Ax specific form by clicking Ax icon without navigating in Ax module.

There is a requirement for one of client to open directly Job registration form by clicking Ax icon in desktop.
To Acheive these you have to do below changes.

1.Create a text file and enter the below script and save as JobRegistration.xml.


<?xml version="1.0" ?>
<AxaptaAutoRun
logfile="C:\\Users\\axtest1\\JobRegistrationLog.log"
logToScreen="false"
version="6.2"
exitWhenDone="false">
<Run type="displayMenuItem" name="JmgRegistrationClockInOut"/>
</AxaptaAutoRun>

2.Go to the Ax client configuration and create a new configuration and specify below

Command to run at the Application startup: AutoRun_C:\Users\axtest1\JobRegistration.xml

save the file as .axc in desktop.

Now you are done,click on the newly created .axc file and it will open directly Ax JmgRegistrationClockInOut form.


X++ job to delete data based on table prefix(cust/vend/kanban etc)

 In the below job we are deleting all data related to Kanban (prefix).you can use it for different prefix,just change the prefix in the code.

static void KanbanDelete(Args _args)
{
   
    int i =1;
    #AviFiles
    SysOperationProgress progress = new SysOperationProgress();
    Common common;
    #AOT
    Name name;
    NumberOf recordCount;
    TreeNode treeNode;
    SysDictTable sysDictTable;
    Connection      connection;
    Statement       statement;
    str             query;
    DataAreaId      currentDataArea;
    ;
    progress.setCaption("Loading…");
    progress.setAnimation(#AviUpdate);

    treeNode = TreeNode::findNode(#TablesPath);
    treeNode =  treeNode.AOTfirstChild();
    progress.setTotal(treeNode.AOTchildNodeCount());
    while (treeNode)
    {
        name = treeNode.AOTname();
        if(name like "kanban")
        {
            sysDictTable = SysDictTable::newTableId(treeNode.applObjectId());
            recordCount = sysDictTable.recordCount();
            if (recordCount)
            {
                connection = new Connection();
                statement = connection.createStatement();
                currentDataArea = curext();
                query = "delete from "+name;
                new SqlStatementExecutePermission(query).assert();
                statement.executeUpdate(query);
                CodeAccessPermission::revertAssert();
            }
        }
        progress.setText(strFmt("%1" ,name));
        progress.setCount(i, 1);
        i++;
        treeNode = treeNode.AOTnextSibling();
    }

}

Saturday, August 13, 2016

Test a WebService without any code and later consume in AX.

Hello Friends,

In our current Project we have a huge integration and get several web service call.
To validate the Web service before consuming through ax ,we can use different methodology.
1.SOAP UI :
Click the SOAP and Add the given WSDL  and press enter.
click on the operation and right side window will come.
enter the input request and run it.
right side you will get the response in the xml format.
 
2.WCF Test Client:
If VS is installed in your system ,then by default it will install WCF test client 
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE
 
Add the WSDL under File>Add service and press enter.
Pass the input top panel and see the response in the below panel.

Once the outcomes is tested and validated,
you can the webService WSDL in Service Reference of a VS project.
Build the solution and deploy and Add to AOT.
It will reflect in AX under VS project area(Csharp projects)
Restart the client ,then only impact can be observe via code level.
Now you are ready to use the Web service through AX business logic.

Friday, February 13, 2015

Include multiple PO in the generate xml via AIF outbound.

Hi Friends,
In my current project, we have a scenario to generate multiple PO in a single xml file via batch process.

So initially decide to use send electronically feature in PO Confirmation form.If we use the logic in while loop for multiple PO number then it will create multiple xml file for each of the PO. So we need a solution to sum up all the xml into 1 xml.
We have introduced below piece of code to achieve the result. Multiple PO in single XML.
Multiple PO in Multiple XML.
Just add a while loop in below code.





Financial Dimension bug exist in DIXF functionality in standard Ax2012 R2 CU6.

Hi Friends,

while working in my current project,one of my functional person report issue on DIXF financial dimension.
Let me explain the issue:
Standard Ax2012 functionality:
Go the GL - General Journal
Create a journal.
Enter the Ledger account,based on the enter ledger account it will decide which configure account structure to be used.

cost-center-Purpose dimension structure value comes from below setup form.
(GL - Setup - Chart of accounts - configure account structure.









DIXF scenario:
We can use standard DIXF entity to import the ledger journal entity.(Opening Balance)







Based on the input ledger account it should validate that passing financial Dimension  with ledger is right or wrong.
But it is not happening.
financial dimension is static in DIXF import,not depends on passing ledger account.
it comes from default legal entity setup.
Coding issue & Solution:
\Classes\DMFDimensionHelper\generateDynamicDimension()
Red marked code always search first only,but it is wrong approach.
It should find based on the passed ledger account number.








Now if you try to import the CSV file via DIXF it will take right financial dimension.

Friday, November 21, 2014

Global::buf2buf() doesn’t work correctly when used with inherited tables.

Hi Friends,

While working on my current project,I faced a issue with the Microsoft Standard Global function.

I have a requirement to copy data of a table.But it is intercompany process.So I can't use the data method.
As Data method copy the sys fields also but in Buf2 Buf it just copy the data fields,not the sys fields.
So decide to use buf2buf.But in my scenario it doesn't work due to table inheritance.

derived table data get copy but not the base table data.

or
base table data get copy but not the derived table data.

Solution:
 I found the Solution in Ax2012 R3.
 Here scope is defined,So you have to pass additional the scope as parameter.
If you are copying derived table data ,then you have to pass baseTable as scope.
If you are copying base table data ,then you have to pass derived as scope.

static void buf2Buf(
    Common  _from,
    Common  _to,
    TableScope _scope = TableScope::CurrentTableOnly
    )
{
    DictTable   dictTable = new DictTable(_from.TableId);
    FieldId     fieldId   = dictTable.fieldNext(0, _scope);
    while (fieldId && ! isSysId(fieldId))
    {
        _to.(fieldId)   = _from.(fieldId);
        fieldId         = dictTable.fieldNext(fieldId, _scope);
    }
}

Tuesday, November 5, 2013

Ax2012 AIF known issues.


Hi Guys,

Today while working in AIF I found some issues.

1.while activating a Inbound Enhance port having HTTP adapter I was getting below error.
The deployment web site was not found for port.

Solution: Go to the Ax>System administration>setup>AIF>Website>remove the end slash of the URL (\).
http://localhost:85/MicrosoftDynamicsAXAif60\
it should be like below
http://localhost:85/MicrosoftDynamicsAXAif60

2.While accessing  the WSDL path I was getting below error.
It seems that there is not enough memory available. Please release some memory space. (Go to the Task Manager>Process> stop unwanted processes which is consuming more memory)

 

 



Deploying all SSRS reports or single report in D365FSCM Using PowerShell.

  All reports can be deployed using following commands . 1. Open PowerShell run as administrator  2.Copy and paste below command and enter....