How to Import Records from Excel Using X++ Code in D365FO

  How to Import Records from Excel Using X++ Code in D365FO   Include the below namespace in X++ code it will requires to import Excel. Using System.IO; Using OfficeOpenXml; Using OfficeOpenXml.ExcelPackage; Using OfficeOpenXml.ExcelRange;   In addition to the basic reference, include (Directory and DirectoryUpgrade Packages) X++ Code: Using System.IO; Using OfficeOpenXml; Using OfficeOpenXml.ExcelPackage; Using OfficeOpenXml.ExcelRange; class ReadExcel {   public static void main(Args _args)    {     Int id;     Str Name;      System.IO.Stream stream;       ExcelSpreadsheetName sheet;              FileUploadBuild fileUpload,fileUploadBuild;       DialogGroup dialogUploadGroup;       FormBuildControl formBuildControl;   ...

Get name and personnel number of user D365 FO and AX 2012 using x++

Get name and personnel number of user D365 FO Ax 2012 using x++

//The X++ code can be used in Microsoft Dynamics AX 2012 & Microsoft Dynamics 365 for Finance and Operations
                  
 class CurrentUserNameJob
 {
       public static void main(Args _args)
        {
                  HcmWorker hcmWorker;
                  DirPersonUser dirPersonUser;
                  DirPerson dirPerson;
                  DirPartyTable dirPartyTable;
         
                  select * from hcmWorker
                      where hcmWorker.RecId == hcmWorker::userId2Worker(curUserId());
                 
                  select * from dirPerson
                      where dirPerson.RecId == hcmWorker.Person;
                 
                  select * from dirPartyTable
                      where dirPartyTable.RecId == dirPerson.RecId;
         
                 
                  info(strFmt("Current User Id: %1", curUserId()));
                  info(strFmt("Personnel Number: %1", hcmWorker.PersonnelNumber));
                  info(strFmt("Name: %1", DirPartyTable.Name));
        }
}

Comments

Popular posts from this blog

D365 FO: REFRESH CALLER FORM DATA SOURCE FROM A CLASS X++

Passing Args from one Form to another Form in dynamics AX

CREATE AND POSTING PURCHASE ORDER THROUGH X++ DYNAMICS AX