Alfasith AX

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

Sunday, September 29, 2019

ValidTimeState in child table relation in AX 2012 / D365

Hi,

   while select validTimeState(AsOnToday) * from hcmEmployment join hcmWorker
        where  hcmWorker.RecId == hcmEmployment .Worker &&
      hcmWorker.PersonnelNumber == "1269"
    {
        print hcmEmployment .ValidFrom;
    }
    pause;
}

Regards

Tuesday, September 24, 2019

Tuesday, September 3, 2019

User ID to user name or Worker Name in AX 2012 / D365

Hi,

Worker = HcmWorker::find(DirPersonUser::findUserWorkerReference(UserId));

or

    public static Name userName(UserId _userId)
{
    DirPartyName        partyName;

    partyName = DirPersonUser::userId2Name(this.UserId); //_UserId
    if (!partyName)
        partyName = (select firstonly Name from userInfo where userInfo.Id == this.UserId).Name;
    if (!partyName)
        partyName = this.UserId;
    return partyName;
}

public static UserID Worker2UserId(HcmWorkerRecId _WorkerRecId)
{
    DirPersonUser   personUser;
    HcmWorker       worker;
     select User from personUser
         exists join worker
            where worker.Person == personUser.PersonParty
                    && worker.RecId == _WorkerRecId;
   
    return personUser.User;
}

Regards

Monday, September 2, 2019

Assembly containing type Microsoft.Dynamics.AX.Framework.Tools.DMF.ServiceProxy.DmfEntityProxy is not referenced

Hi,

Error: "Assembly containing type Microsoft.Dynamics.AX.Framework.Tools.DMF.ServiceProxy.DmfEntityProxy is not referenced"

It clearly says that no reference found.

Solution:

DMF is not installed.

Regards,

SQL code to upate one Legal entity banner to all the legal entity in D365

 Hi, update companyimage set  companyimage.Image  = companyimageA.Image  from  ( select Image from companyimage where dataAreaid = 'USF...