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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Import job to update Bank Accounts

(0) ShareShare
ReportReport
Posted on by 55

Hi there,

I need to create a job to import an Excel file with multiple bank accounts (VendBankAccount table), in order to update their details. From what I saw online and on past developments, I created four classes: Controller, Contract, UIBuilder and a Service. I'm now trying to add my custom logic on the service class, but I'm having some issues.

The excel file will have 3 columns: Vendor AccountBank Account ID and Custom Field.

How can I create a piece of code that "tells" D365 that this account, from this vendor needs to change this field to X?

I already created my loop, in order to skip the first Excel line (column headers) and scroll through the whole file, until there is no more information left.

I have the same question (0)
  • Suggested answer
    nunomaia Profile Picture
    23 Moderator on at
    RE: Import job to update Bank Accounts

    Try something like this 

    using (ExcelPackage excelPackage = new ExcelPackage(stream))
                    {
                        int                         rowCount, i;
                        excelPackage.Load(stream);
                        ExcelWorksheet  worksheet   = excelPackage.get_Workbook().get_Worksheets().get_Item(1); // first worksheet
                        OfficeOpenXml.ExcelRange    range       = worksheet.Cells;
                        rowCount                  = worksheet.Dimension.End.Row – worksheet.Dimension.Start.Row   1;
    
                        for (i = 2; i<= rowCount; i  )
                        {
                            range.get_Item(i, 1).value; // row i, cell 1
                            range.get_Item(i, 2).value; // row i, cell 2
                        }
                    }

  • André Arnaud de Calavon Profile Picture
    299,390 Super User 2025 Season 2 on at
    RE: Import job to update Bank Accounts

    Hi joaoasilva11,

    Have you considered using data data management import with a data entity instead of more cumbersome coding?

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,029

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 582 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans