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 :
Finance | Project Operations, Human Resources, ...
Unanswered

API - ImportFromPackage: Creating the package from our integration

(0) ShareShare
ReportReport
Posted on by 5

Morning everyone, hoping someone can point me in the right direction!

We're attempting to make use of the ImportFromPackage API call to deal with potential throttling issues in the future but I'm having issues getting the data into the correct format for a package.

The uploaded package requires:

(EntityTemplateFile).xls/xml 

PackageHeader.xml

Manifest.xml

If I view the job in the Finance and Operations Data Management tab I can click download which will give me a zipfile containing all 3 of these files, the entity template file containing empty tags.

My question is either:

A) How can I download this template zip file from my C# integration so that I can inject our data 

Or

B) How do I format our data into a package that looks like the above without downloading a zip

This has had me stumped for the better half of 4 days so any help would be greatly appreciated!

Kind Regards

Craig

p.s I've looked at the examples here - https://github.com/microsoft/Dynamics-AX-Integration/tree/master/FileBasedIntegrationSamples/ConsoleAppSamples

but unfortunately these just start with a pre-packaged zip file!

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

    When I worked on a similar problem, I wrote a C# application to generate (and zip) these files.

    I manually downloaded sample files, generated classes from XML, used C# code to populate these objects with data and serialize objects to XML.

  • Craig Hemingway Profile Picture
    5 on at

    Did you stored the files you downloaded manually in your code base?

    Ideally I want to download this dynamically.

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

    Now, I didn't store the files. I used them just to generate classes used in my code.

    I see just complications in your approach. It means that you need to have an export project for everything that you want to import, which must be set up in advance (or generated by some other API), you would need to make an extra request every time when you want to prepare data to import and you'd be downloading the same thing again and again.

    Simply generating the files looks easier to me and it does work fine.

  • Craig Hemingway Profile Picture
    5 on at

    How did you account for unknowns in manifest.xml. The file contains a number of elements that only D365 would understand and I have no way of knowing how to generate such as <QueryData> and <SampleFileName>.

    Also on the import project page theres a download button that returns the exact files I need, its just not exposed to the API. Fair enough it would be 2 calls but I would say the extra work and accrued technical debt of builders generating the files is heavier than an additional call.

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

    I don't think you need to deal with either QueryData or SampleFileName.

    You need a query for export, but not for an import. You're not quering F&O - you're working with the data you have in the file.

    You need no sample file either. It's used when you want to get a file with the right structure, so it can be populated manually.

    I'm quite sure that I didn't do anything at all with these two properties.

    If your business process allow setting projects manually, then all right. I wasn't in that position - I generated packages from input data, not from projects manually set up in advance in F&O.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 565 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans