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

D365 FO X++ and the dangers of converting enum to string

 D365 FO X++ and the dangers of converting enum to string

When converting an enum to string in X++.

If you are using enum2str() the result depends on the  preferred locale.

PurchRFQType prt = PurchRFQType::Received;

str result = enum2Str(prt);

info(result); 


 


If you are using enum2symbol the resulting string to be the name of the enum value 

PurchRFQType prt = PurchRFQType::Received;

str result = enum2Symbol(enumNum(PurchRFQType), prt);

info(result); 

// info  "Received" regardless of the locale

 

Comments

Popular posts from this blog

Passing Args from one Form to another Form in dynamics AX

Create and Post Inventory Adjustment Journal in AX / D365 FO via X++

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