Read Excel file using OpenXMLSDK Dynamics 365(AX-7)


Read Excel file using OpenXMLSDK Dynamics 365(AX-7)

Following is code you can use to read Excel using Open XML.






using DocumentFormat.OpenXml;
using System;
using System.Linq;
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Spreadsheet;

public class SLAX7_ImportClass
{

public void testRun()
{
OXMLSpreadsheetDocument_RU document = OXMLSpreadsheetDocument_RU::construct("C:\\AX\\Test.xlsx");
OXMLWorkBook_RU workbook = OXMLWorkBook_RU::construct(document);

OXMLWorksheet_RU worksheet = workbook.getWorksheet(1);

OXMLRow_RU row = worksheet.row(1);
OXMLCell_RU cell = Row.cell(1);
Global::info(strFmt('%1',cell.getValue()));

}

}

Support Faryal's Cusine


Process Data packages Life Cycle Services


Process Data packages


Following are the steps to create Process data packages using LCS and apply to your environment.


Step-1 Navigate to Data Management Workspace and click on Export Tile.

Reference screenshot




Step-2 select any entity and export the data in Excel. Which we will use in the next step. then click on download the package.

Reference screenshot




Step-3 Now login to LCS and navigate to Assets library and click on the data packages Tab.

Step-4 Add the New data package and upload the package. which we downloaded in step-2. 

Reference screenshot




Step-5 Now click on Process Data Packages and click on the + icon to add a new PDP.

Step-6 Pre-requisite Business Process required to create Process Data Package.

Step-7 Click on + Icon to add Process data packages. Popup will appear fill out the required fields and click on confirm.


Reference screenshot




Step-8 New screen will appear in 3 to 4 seconds. 

Step-9 Select the business process (Step-6) and click on Next.

Reference screenshot





Step-10 Now click on select data packages and select your required package from the popup and click confirm.

Reference screenshot





Step-11 Add the package dependency if any. in my case there is no dependency. so I skipped this step and click on next for the last step of this wizard.

Reference screenshot



Step-12 Now select your business process and click on data packages and save the complete process.

Reference screenshot



Step-13 Navigate to the Assets library again and click on the Process data packages Tab.

Step-14 Select your required Process and click on consume icon.

Reference screenshot


Step-15 Click on consume new process data packages.

Reference screenshot





Step-16 fill the required fields like the below screenshot and click on Create.

Reference screenshot



 Step-17 Now click on newly created records to open the PDP in the new window.

Reference screenshot



Step-18 New window has 3 following steps.
  1. Review
  2. Review & Approval
  3. Apply Data package.

Step-19 select the process node and Mark process as reviewed. In my case, I have marked the complete process as reviewed.

Reference screenshot



Step-20 On the 2nd step mark as approved this operation will navigate to you on the new screen.

Step-21 Click on approve icon to change the status from Not Started to Approve

Reference screenshot



Step-21  If you want to change the data package click on upload data package else skip this step.

 Reference screenshot



Step-22 Click on Apply icon to start the process. To perform this activity you should have Admin (tenant user on) your desired environment.

Step-23 Select the company from the popup and click on apply.

Reference screenshot


Step-24 Once the process starts, it will change the status to in-progress then complete if everything works fine.

Reference screenshot





Please feel free to contact me if you are facing any issues during the implementation of this blog. 



Support Faryal's Cusine


Virtual Fields Vs Computed Fields

  Virtual Field: A virtual field in D365FO is a field that doesn't have a direct representation in the database. It's a field that y...