MSDyn365FO. How to Import CSV file using Electronic Reporting. Part 4 – Map Model to Datasource.

That’s the last step. We have Format to parse data to a model, now we need to write data from model back to actual tables. Open model designer and click “Map model to datasource” in the action pane.

Create new record, set name and description. Select direction, for import it should be “To destination”:

MapDatasourceMapping

Open designer. In the Data Sources area add data model:

MapDatasourceMappingAddModel

Set name, select model and definition:

MapDatasourceMappingAddModelProperties

Add new destination:

MapDatasourceMappingAddDestination

Select table you want to insert to, set name, specify if it should support insert or update\insert and if you need validation to be triggered:

MapDatasourceMappingAddDestinationSelectTable

Bind Record List from model to tables’ record list and bind field accordingly:

MapDatasourceMappingBind

Save and we are ready to test it!

Go back to Model to Datasource mapping screen, select mapping record and click run in the action pane:

MapDatasourceMappingRun

Select file and check the result. I do not have UI for this table, so just going to use table browser:

ImportCSV_TableBrowser

It’s not that nice to trigger import from the mapping record but that’s the only way I know and in the next post we will look how to trigger it from X++ code, so we could have a button somewhere.

As you can see ER is a really powerful tool that allows users to do tasks that were not possible without development before.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s