Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Sunday, November 29, 2020

Minumum and Maximum date in AX 2012 / D365

 H,

// Minimum dateTime and Maximum DateTime

    utcdatetime                 minDateTime = DateTimeUtil::minValue();

    utcdatetime                 maxDateTime = DateTimeUtil::maxValue();


// Minimum date and Maximum Date

    TransDate                 minDate = dateNull();

    TransDate                 maxDate = dateMax();


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,

Saturday, November 14, 2020

Why DirPerson table is not exists in SQL

Hi,


Why DirPerson table is not exists in SQL?


The DirPerson table has the property SupportInHeritance with YES and Extends with DirPartyTable.


SQL Table architecture doesnt support inheritance.


There are few more tables in AX with such property example OMOperatingUnit.


Regards,

Sunday, November 8, 2020

Marshaling Webservices enum to X++ during integration

 Hi,


    NICServiceLibrary.EltezamServiceRef.GenderType           M,F,N;

    M = NICServiceLibrary.EltezamServiceRef.GenderType::M;

    F = NICServiceLibrary.EltezamServiceRef.GenderType::F;

    N = NICServiceLibrary.EltezamServiceRef.GenderType::N;

;

        PersonalInfoStructure.set_Gender(M);


Regards,


Monday, November 2, 2020

SSRS reports prompts for user credentails in Dynamics AX / 365

 Hello,


If you experience anytime SSRS reports prompts for user credentails in Dynamics AX / 365, then the respective datasets in report may use type of AXREPORTDATAPROVIDER / AXQUERY doesn't parse the users credentails during report run time to DataSource in SSRS DB (ReportServer).


Integrated Windows Authentication(IWA) is the microsoft authentication protocal, using windows login credentials to autheticate the Microsoft product. In Dynamics AX 2009 / 2012 R2 / 2012 R3 uses IWA. If an application is not opening or running close and reopens same way we needs to to SSRS too.


Solution: We needs refresh the credentails flow, so drop the contents in reports folder and recreate and redeploy all the reports


Regards.

Thursday, October 29, 2020

Microsoft stopped allowing the users to download the release of VS 2013 and its Updates

Hi,


Microsoft stopped allowing the users to download the release of VS 2013 and its Updates, for encourage the user use latest version.






Regards,

Working on Visual Studio 2013 for Dynamics AX 2012 R3 development.

Hi.,


Morphx is the Microsoft Dynamics AX development environment, We all the developers are familiar with this development environment. Only SSRS and retails developments are going on Visual studio, whereas Microsift Dynamics AX 2012 R3 CU 13 support Visual Studio as development environment.


Microsoft Dynamics AX and Visual Studio are integrated through Visual Studio Tools. VS Tools is a enables the AOT objects in VS for the development for Microsoft Dynamics AX.


The AOT objects are IDE(Integrated Development Environment) with VS by VS tools.


For more details click here

Regards,


Visual Studio Tools for AX 2012 R3 : Do Microsoft Dynamics AX 2012 R3 CU13 support Visual Studio 2019?

Hi,


AX 2012 R3 CU10 or later doesn't support other than Visual Studio 2013 Update 2 or later.


The latest version of AX 2012 R3 CU13 is not supporting Visual Studio 2015.


Microsoft Visual Studio Team Foundation Server 2017 is now supported with AX 2012 R3 CU 13.


Regards,

Wednesday, April 15, 2020

Get AccountNum of vendor / Customer from ledgerDimension in AX 2012 / D365

Hi,

This applicable for LedgerJournalACType::Cust or LedgerJournalACType::Vend

DimensionStorage::ledgerDimension2AccountNum(LedgerJournalTrans.LedgerDimension);

Regards,

Get main account from dimension in D365

Hi,

LedgerDimensionFacade::getMainAccountFromLedgerDimension(
                                                  ledgerJournalTrans.OffsetLedgerDimension).MainAccountId;

Regards,

Thursday, April 2, 2020

Seperate dimension value from financial dimension in D365 / AX 2012 R3


public static DimensionValue getDimensionValue(int64 _dimension,
                                                                                            DimensionValueName _dimAttribute)
{
     DimensionAttributeValueSetStorage     dimensionAttributeValueSetStorage;
     dimensionAttributeValueSetStorage  = DimensionAttributeValueSetStorage::find(_dimension);
   
     return dimensionAttributeValueSetStorage.getDisplayValueByDimensionAttribute( DimensionAttribute::findByName(_dimAttribute).RecId);
}

Thursday, February 13, 2020

HcmPositionHirarchy To whom position needs to report in upper ranking in AX 2012 / D365

Hi,

static void AlfPositionHirarchyUP(Args _args)
{
    HcmWorker                   HcmWorker;
    HcmPositionWorkerAssignment HcmPositionWorkerAssignment;
    HcmPositionHierarchy        HcmPositionHierarchy;
    HcmPositionRecId            positionRecId;
 
    positionRecId = HcmPosition::findByPosition(HcmWorker::findByPersonnelNumber('701027').primaryPositionId()).RecId;

while(positionRecId>0)
{
    select * from HcmPositionHierarchy
        where HcmPositionHierarchy.Position ==positionRecId;

    positionRecId=HcmPositionHierarchy.ParentPosition ;
    if(HcmPositionHierarchy.ParentPosition)
    {
        print HcmWorker::find(HcmPosition::getReportsToWorker(HcmPositionHierarchy.Position)).name();
    }
}
pause;
}

Regards,

HcmPositionHirarchy under a position in AX 2012 /D365

Hi,

static void AlfPositionHirarchyDown(Args _args)
{
    HcmWorker                   HcmWorker;
    HcmPositionWorkerAssignment HcmPositionWorkerAssignment;
    HcmPositionHierarchy        HcmPositionHierarchyMan,HcmPositionHierarchy;
    HcmPositionRecId            positionRecId;
 
    positionRecId = HcmPosition::findByPosition(HcmWorker::findByPersonnelNumber('701027').primaryPositionId()).RecId;

    while select HcmPositionHierarchy where HcmPositionHierarchy.ParentPosition == positionRecId
    {
        print HcmWorker::find(HcmPosition::getWorker(HcmPositionHierarchy.Position)).name();
    }
    pause;
}

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