Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Importing file via web services

Posted on by 430

Hi Experts,

I want to import a file via a web service in AX.

I am able to to read record from Dynamics Ax 2012 using aif service through c# code.

Now i want to create record in Dynamics Ax 2012.
Can anyone suggest me that how to achieve this.

Thanks

Sona Jee

*This post is locked for comments

  • Martin Dráb Profile Picture
    Martin Dráb 230,188 Most Valuable Professional on at
    RE: Importing file via web services

    Creating new AIF document services is a very different topic, therefore if you want to talk about that, please create a new thread.

    Nevertheless the error message is clear - you've picked a name that already exists in your AX application. You must use another name.

  • Sona Jee Profile Picture
    Sona Jee 430 on at
    RE: Importing file via web services

    Hi Martin,

    While Creating a Document Inbound AIF Service.

    I have following this link:

    community.dynamics.com/.../creating-a-document-inbound-aif-service-in-microsoft-dynamics-ax-2012

    During select code generation parameters step, when i click on next , i received following warning:

    "The document object class name is already used by an existing table"

    Please suggest how to resolve this.

    Thanks

    Sona

  • Martin Dráb Profile Picture
    Martin Dráb 230,188 Most Valuable Professional on at
    RE: Importing file via web services

    If you know how to read the data, you must know how to add a reference into Visual Studio (which generates proxy classes), how to create the client object and how to call it's 'read' operation.

    Using the 'create' operation is similar - you'll call create() instead of read() and provide the data to be inserted as a parameter. Here you can find simple code demonstrating it on SalesSalesOrderService.

  • Sona Jee Profile Picture
    Sona Jee 430 on at
    RE: Importing file via web services

    Hi Martin,

    I have trying to use an AIF document service for inserting list of records in AX staging table.

    Thanks

    Sona Jee

  • Martin Dráb Profile Picture
    Martin Dráb 230,188 Most Valuable Professional on at
    RE: Importing file via web services

    You still didn't confirm whether you're trying to use an AIF document service. Please confirm my assumption before we get into details.

    By the way, AX 2012 has the Data Import Export Framework for importing data and it can handle Excel files too. Did you consider using that instead of writing code?

  • Sona Jee Profile Picture
    Sona Jee 430 on at
    RE: Importing file via web services

    Hi Martin,

    I don't know how to create and i am using excel file.

    So please guide me how to achieve this.

    Thanks

    Sona

  • Martin Dráb Profile Picture
    Martin Dráb 230,188 Most Valuable Professional on at
    RE: Importing file via web services

    What do you mean by "the same"?

    Does it mean that you don't know how to call 'create' at all?

    Or that you need some help with parsing the file? If so, how could I give you a link explaining how to handle your specific format if you haven't told us what the format is?

  • Sona Jee Profile Picture
    Sona Jee 430 on at
    RE: Importing file via web services

    Hi Martin,

    Please provide some link for the same.

    Thanks

    Sona Jee

  • Martin Dráb Profile Picture
    Martin Dráb 230,188 Most Valuable Professional on at
    RE: Importing file via web services

    If you're using an AIF document service, you shouldn't upload the file as such to AX. You should parse it, set values to proxy classes representing the document and pass it to the 'create' operation of the document service.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans