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.
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:
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.

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

 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 (\).
it should be like below

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)



Sunday, October 6, 2013

How to expose Webservice through AIF framwork in Ax2012 R2 version.

Hi Friends,
Today I am going to discuss on creation of web service in Ax2012 application and how to expose the service to 3rd party by using the AIF concept.

1.I have created  my own customize Table.

2.Create a query by using 'AXD' prefix and add that table.

3.Go to the Tools>AIF>create Document service.

5.Select the created query here and provide the document class name.

6.Select the operations which you want to expose.
7.Finish the wizard and it will create a private project which contains all the necessary objects which will be needed when exposing a service. 
    a. The Ax 
classes (sometimes referred to as AxBC classes) manage data, manage access to and from the tables, encapsulate the business logic that is available through the corresponding form, create default field values, and provide an object interface to the individual tables.

b.The Axd class is responsible for maintaining the internal data for the document and for creating XML from that data or populating itself with XML data.

 C.Service ,Document service class and Macro.
8.Go to the Service node and select the already created service and right click on that and register it.

9.It will open a form which will show you the operations which are registered already.

 If you want see the XML  click the Parameter schema.

10.Create a inbound port or you can use a existing port.
Based on your requirement you can select Basic/enhance port type.
Here I select Enhance Inbound port.
select the physical path of the website where you want to deploy.

11.Select the operations which you want to include in this inbound port.

12.Click on the Activate button and it will generate the artifact.

13.Now you can go to the VS and click on Add to reference and provide the WSDL path can see all the operations there.

Common issue:
All the Aif related log records created in below location
Go to the System Adminstrator > Periodic>Services and Application Intregation Framework>Exceptions
 When you create a new query you might get below error.Go to the data source fields property change Dynamics parameter value from unselected to yes/no.

 When you finish the AIF document service wizard you might get below error.

Solution : If your business scenario require to implement cache concept then do it here or else remove the 2 methods.

 If you are unable to select the website in the Inbound port form please check the 
setup of website and try to validate it.