Notifications
Announcements
No record found.
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,
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
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
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:
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;
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.
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 .
will the above line works in UI builder class to capture the range?
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 664 Most Valuable Professional
André Arnaud de Cal... 522 Super User 2025 Season 2
Sohaib Cheema 303 User Group Leader