Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا
Showing posts with label Integrations. Show all posts
Showing posts with label Integrations. Show all posts

Wednesday, July 7, 2021

REST Vs SOAP in AX 2012/D365

Hi,

The integration between 2 application/platform to perform the action of integration is termed as API (Application programming interface).

Integration will be in the forms of URL that contains service address with hosted location (server).

REST and SOAP are the 2 API services.

The REST and SOAP has its own unique properties and behaviour.

SOAP will support only XML structure of data format.

REST supports all the structure of data format viz JSON.

WSDL (Web Services Description Language) based call services are SOAP API.

AX 2012 cannot be integrated directly from any API, for that we have to create serviceReference in Visual Studio and to be deploy the project in AOT to consume the functions and object present in that services.

AX2012 supports only SOAP web services.

 D365 can be integrated by custom web services or ODATA. It creates 2 endpoints one for REST and other of SOAP.

Regards,

Monday, November 23, 2020

Convert Gregorian to Hijiri in D365

Hi,


The date value retuned by umAlQuraCalendar is not in the range of AX / 365 TransDate allowed. TransDate support from 1/1/1900 to 1/1/2155. You might be noticed Never as dateMax() value in AX tables, All those never is nothing but 1/1/2155.

Please find following script to convert Gregorian to Hijri with date separator "-".

I got an requirment to convert the date where Integrating system is not accepts 29-4-1442, API is looking for 29-04-1442

I added 0 before to the day and month if its less than 9.

Most of the functions available in umAlQura returns or accepts int32, please make sure you convert before you proceed with.

NOTE: Please dont try to covert the string what hijri returns to transDate, that results in error.

public static str 30 Gregorian2Hijri(TransDate _transDate)

{

    System.Globalization.UmAlQuraCalendar umAlQuraCalendar = new System.Globalization.UmAlQuraCalendar();

    System.Globalization.GregorianCalendar gregorianCalendar = new System.Globalization.GregorianCalendar();

    str yearStr, monthStr, dayOfMonthStr;

    ;

    yearStr = umAlQuraCalendar.GetYear(_transDate);

    monthStr = umAlQuraCalendar.GetMonth(_transDate);

    dayOfMonthStr = umAlQuraCalendar.GetDayOfMonth(_transDate);

    if(strLen(monthStr) == 1)

        monthStr = "0"+monthStr;

    if(strLen(dayOfMonthStr) == 1)

        dayOfMonthStr = "0"+dayOfMonthStr;

    return strFmt("%1-%2-%3",dayOfMonthStr,monthStr,yearStr);

}

Regards,

How find size of recordsortedlist in D365/AX 2012

Hi, This is the continuity of the previous article where we are now getting the size of recordsortedlist . if(recordsortedlist.len() >1) ...