Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

How to import/export csv files in the RTC

Posted on by 160

Can anyone explain how to import/export csv files in the RTC?

Well, first of all I am just trying with a very simple exsample for exercise.

I have created XMLport based on "Post Code" table, and I need I to work both ways(import/export).

The XMLport should export/import data as csv  file.

I have changed the Format property to "Variable Text" and when I run the XMLport data is exported in XML format.

I don't know how to make the XMLport to act as dataport.

Do I have to change some other properties or add some code to XMLport?

I was searching the web for an example or an explanation on this, but could find anything.

Would you be kind enough to explain me what I am doing wrong or maybe give an example.

 

*This post is locked for comments

  • Daniel Rimmelzwaan Profile Picture
    Daniel Rimmelzwaan 3,485 on at
    Re: Re: Re: Re: Re: Re: Re: Re: How to import/export csv files in the RTC

    I'd have to debug that process and see for myself what is going on. Like I said I've never seen an XMLPort just automatically wipe out the content of a file. Did you ask your NAV partner?

  • Mark Kinsella Profile Picture
    Mark Kinsella 60 on at
    Re: Re: Re: Re: Re: Re: Re: How to import/export csv files in the RTC

     When I look at the file after the error occurs it's empty. It's 0kb, and when I open it in notepad there is no lines in it. To begin with it had about 50 lines of data.

  • Daniel Rimmelzwaan Profile Picture
    Daniel Rimmelzwaan 3,485 on at
    Re: Re: Re: Re: Re: Re: How to import/export csv files in the RTC

    The reason that the error is occuring is that the XMLPort is expecting an element that is not there. I've never seen an XMLPort delete anything from a file, if it indeed does that, there should be code in there, it does not just wipe out the content of a file.

    How did you determine that it deletes data?

  • Mark Kinsella Profile Picture
    Mark Kinsella 60 on at
    Re: Re: Re: Re: Re: How to import/export csv files in the RTC

    [quote user="Daniel Rimmelzwaan [MVP]"]

    That message means that your XMLPort has an element called <Resource> defined, and the MinOccurs property is set to 'Once'. This means that the design of your XMLPort specifies that this element MUST at least have one occurrance. If that element doesn't have to be there, you can set the property to 'Zero'.

    [/quote]

    Hi Daniel, thanks for that. Yeh I understand the property alright, but the reason the error is occurring is because for some reason the XMLPort is deleting all the lines from my csv file first and then of course it tries to run and finds no records and hence the error...?
  • Daniel Rimmelzwaan Profile Picture
    Daniel Rimmelzwaan 3,485 on at
    Re: Re: Re: Re: How to import/export csv files in the RTC

    That message means that your XMLPort has an element called <Resource> defined, and the MinOccurs property is set to 'Once'. This means that the design of your XMLPort specifies that this element MUST at least have one occurrance. If that element doesn't have to be there, you can set the property to 'Zero'.

  • Mark Kinsella Profile Picture
    Mark Kinsella 60 on at
    Re: Re: Re: How to import/export csv files in the RTC

    Hi fella's,

    I've an issue with this also. I can export to a .csv file no problem with an XMLPort through the RTC. However, when I try to import the same file, using the same XMLPort, it doesn't work. I get the following message:

    The Element <Resource> is expected by Min Occurs value:Once. Element received: <>.

    It also clears all of the data out of the .csv file, which is why the above error is occuring I believe?

    Any idea's?

  • Daniel Rimmelzwaan Profile Picture
    Daniel Rimmelzwaan 3,485 on at
    Re: Re: How to import/export csv files in the RTC

    For those of you following this topic, Maris has found a solution in another forum: http://dynamicsuser.net/forums/t/27479.aspx

  • maris Profile Picture
    maris 160 on at
    Re: How to import/export csv files in the RTC

     It works from RTC.

    I don't know why in the world I tested xmlport from CC.

     

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,030 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans