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 :
Microsoft Dynamics AX (Archived)

Reading multiple excel files from specific folder in ax 7

(0) ShareShare
ReportReport
Posted on by 174

Hi everyone,

I came across requirement where i need to read multiple excel files from a specific folder. I tried many codes but still got stuck while reading data. Actual problem am facing right now is that code only reads the first row of excel and doesn't read rest of the lines, Moreover first row even doesn't return appropriate values instead it return some garbage value. Expertise are required if any one worked before on such an issue. 

The link i have followed is :

http://daxture.blogspot.com/2017/04/ax-2012-reading-files-from-directory.html

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at

    It doesn't seem to make a good sense. How will get Excel files get to a folder on a machine that's managed by Microsoft and you don't have access to it?

    If you have the files on your local machine, AX running in cloud can't reach them. You must use a web service to upload them to AX, where you can use DIXF to import the data. Recurring Integrations Scheduler may help you with that.

    Note that you shouldn't bother writing custom code if DIXF is able to import the files.

  • Farwa Khizar Profile Picture
    174 on at

    Actually i dont want to use DIXF, i want to schedule a batch job that reads excel file from a shared folder in order to upload data in ax

  • Suggested answer
    nmaenpaa Profile Picture
    101,162 Moderator on at

    That's not possible (with the cloud version of D365FO). The environment can't access any local shares in your network. 

    If you want to upload data from a shared folder to D365, you must use an external application for that.

  • Farwa Khizar Profile Picture
    174 on at

    Nikolaos,

    Can you provide any useful link for such stuff?

  • Suggested answer
    nmaenpaa Profile Picture
    101,162 Moderator on at

    Enterprise integrations in general are a very broad topic and not specific do D365FO. You should discuss with someone who knows BizTalk, LogicApps or some other integration platform.

    Also MS has published a sample integearation solution that can be used for dev/test purposes, and as an example on how to exchange information programmatically with D365FO:

    [View:https://github.com/Microsoft/Recurring-Integrations-Scheduler]

    Here's also some info about D365FO integrations and which approach is suitable in different scenarios: [View:https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/data-entities/integration-overview]

  • Farwa Khizar Profile Picture
    174 on at

    Nikoloas,

    What if i use on-premises version of D365, as it doesn't support DMF package API's. Would the custom code i used before will be appropriate in case of an on-premises version? 

    In on-premises version I would have access of server where the excel files would be placed, so i think this code would't cause any issue while reading data from excel.

  • Suggested answer
    nmaenpaa Profile Picture
    101,162 Moderator on at

    With the on premises version I see no reason why you shouldn't be able to read from local folders and fileshares.

  • Farwa Khizar Profile Picture
    174 on at

    Can you suggest any class in D365 in order to read excel file, as in D365 we use CommaIo for csv files, is there any class exist in order to read in excel?

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

    I'm not very sure that you can access file system from Service Fabric containers.

    Also, why exactly do you want to invest your time in developing custom import instead of using what's already there, it'stested and recommended? You really should use data entities for things like this.

    If the answer is that you don't understand data entities and data management, you should fix it be learning them and not by a piece of code.

  • Verified answer
    Farwa Khizar Profile Picture
    174 on at

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans