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??
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.
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??
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.
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.
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
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??
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
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,228 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156