web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to upload a Excel file and batch process it.

(0) ShareShare
ReportReport
Posted on by 20

Hi,

I want to upload an excel file and batch process it by using contract controller and service class.

Can anyone guide me how to do that which parameters to use for browse and upload the file and batch process it.

Thanks in advance,

I have the same question (0)
  • Verified answer
    huijij Profile Picture
    19,811 on at

    Hi udayraj4e9,

    Is this file to be uploaded to the Azure blob?If so,Please go through the old thread for the same customization:

    https://community.dynamics.com/365/financeandoperations/f/dynamics-365-for-finance-and-operations-forum/410316/dialog-for-excel-upload-in-batch-job-sysoperation-framework

    regards

  • udayraj4e9 Profile Picture
    20 on at

    Thank you Judy ,

    i checked the thread ,but the thread don't have a conclusion as their are errors ,but i found those classes helpful .Can you send me with a sample code with all the classes .As you can see in the image ,in place of date and text i need to a have a file path to browse excel files and batch process them
    image_2D00_13.png

  • Verified answer
    Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    What you need is using FormBuildControl class in a UI builder class - use "Find references to see examples of how it's used.

    For instance, review the implementation of TaxSetupImportUIBuilder class. These are the most important pieces:

    • In build(), FileUploadBuild is created and configured.
    • In postRun(), you subscribe to notifyUploadCompleted event.
    • In the event handler (uploadCompleted() method) you take the file content from the file upload control and set it to the contract class.
  • udayraj4e9 Profile Picture
    20 on at

    Thank you martin for the response ,

    I  resolved the  issue of adding file path and browse by adding UI builder class , now the problem comes here with batch processing, while upload excel files, in the run method of UI builder class i want to capture excel sheet range .

    the below line of code works for normal class ,in place of this what should i write in a UI builder class to capture the excel range?

    OfficeOpenXml.ExcelRange    range       = worksheet.Cells;

  • Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    What do you mean by saing that a UI builder class isn't a normal class? Why do you believe that some code can't be used there?

    By the way, can't you simply use data management for data import? It already supports file upload, worksheet selection, Excel file import and batch processing - all the things you're trying to implement again by yourself. What is the feature that you think can't be done with data management? Maybe we can help you to do it - it would be a better thing that building your own solution for data imports.

  • udayraj4e9 Profile Picture
    20 on at

    Thank you Martin,

    As per the requirement i am doing that.

    And what i want to know is that how to capture range of an excel file in UI builder class .

    OfficeOpenXml.ExcelRange    range       = worksheet.Cells;

    will the above line works in UI builder class to capture the range?

  • Verified answer
    Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    You can use any code you want in any class where it makes logical sense. Therefore yes, you can use this line of code in any class, including all UI builder classes. But asking if it will work doesn't make a good sense, because the line can't work in isolation. You need to populate the 'worksheet' object first and then you'll wanrt to use the 'range' object for something.

    I don't know what you're trying to achieve, but I don't think you should be intepretting the file in the UI builder class. The purpose of this class is just building GUI to populate properties of a data contract class. And the contract class merely holds parameters for a certain process (= a service method defined in a controller). The service method is where you should read values from the contract and do something with them.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans