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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

How to call "Import in batch" in DMF functionality through X++ code?

(0) ShareShare
ReportReport
Posted on by 672

Hye ,

User wants to import customers through batch a custom form with excel file browsing option. It can be done through IMPORT in BATCH in DMF but user will not use DMF so wants to trigger "Import in batch" through code.

How can we do that??

  • Sergei Minozhenko Profile Picture
    23,099 on at

    Hi D365FO_Avatar,

    Bank account statement import is using DMF import to import file selected by the user in the dialog.

    Check class BankStatementImportBatch and method doImportBankStatementsDMF for code sample

  • D365FO Avatar Profile Picture
    672 on at

    Hi,

    I saw that method and found there are many classes used in it.

    as Like Import we can use the below code directly. So likewise there is class DMFBatchImporter is called while "Import in batch" calling.

     DMFQuickImportExport::doPGImport(_dmfDefinitionGroup.DefinitionGroupName, _executionId, true, true );

    So there is anything like that or any method in this class??

  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,099 on at

    Hi D365FO Avatar,

    Not sure what method you are looking for. Do you want to have one method which will get the file as an input parameter and do DMF import with?

    In general, you still need to do mandatory steps:

    1. Upload a file to blob storage and get file id

    2. Prepare execution

    3. Run doPGImport

  • D365FO Avatar Profile Picture
    672 on at

    I want to have a dialog form which have a browsing option where user will upload the Excel file and by OK button click this excel file data should be imported in Staging table through batch process.

  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,099 on at

    Hi D365FO Avatar,

    In this case, you can copy-paste needed parts from existing classes to your class. Bank account import statement can be over-complicated from this perspective, but you can find other examples by using cross-reference for DMFQuickImportExport.doPGImport method.

    For example, TaxImportInvoiceTaxIntegration_CN class looks quite simple and you can just copy-paste it and change code a bit to works with a different entity.

  • D365FO Avatar Profile Picture
    672 on at

    Now what I'm thinking to create a sysOperation framework class and read the excel file and upload it in target table.

    We can read the excel file in Batch class??

  • Verified answer
    Sergei Minozhenko Profile Picture
    23,099 on at

    Hi D365FO Avatar,

    Depends on what do you mean by "read excel file in batch".

    Do you mean you want the user to give the ability to select the file in the dialog and run import in batch? This scenario is possible as you need to upload the file anyway to blob storage, so you just need to pack blob storage file identifier before the batch job is scheduled and use it later when the batch is processed.

    If you mean reading a file from some local folder in batch, it's not possible.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 282 Super User 2026 Season 2

#2
Aayush Tiwari Profile Picture

Aayush Tiwari 219

#3
Subra Profile Picture

Subra 211 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans