Error for creating/updating record with a relation

Jun 16, 2015 at 4:20 PM
Edited Jun 16, 2015 at 4:20 PM

I get a error when i start a import with related field, maybe i miss some in the configuration?
System.NullReferenceException: Object reference not set to an instance of an object.
   at IntegrationTool.Module.WriteToDynamicsCrm.Execution.EntityMapper..ctor(EntityMetadata entityMetadata, DataMetadata dataMetadata, List`1 mappings, List`1 picklistMappings)
   at IntegrationTool.Module.WriteToDynamicsCrm.Execution.RelationSetter.SetRelation(String relationMappingLogicalName, Entity[] sourceEntities, IDatastore dataObject, Dictionary`2 relatedEntities)
   at IntegrationTool.Module.WriteToDynamicsCrm.WriteToDynamicsCrm.WriteData(IConnection connection, IDatabaseInterface databaseInterface, IDatastore dataObject, ReportProgressMethod reportProgress)
   at IntegrationTool.ApplicationCore.SubFlowExecution.WriteDataToTarget(IDatastore dataObject, RunLog runLog)
   at IntegrationTool.ApplicationCore.SubFlowExecution.Execute(RunLog runLog)
   at IntegrationTool.Flowmanagement.FlowManager.bgw_DoWork(Object sender, DoWorkEventArgs e)
I hope you can help?
Jun 17, 2015 at 12:30 PM
Hi epellegrom,

could you please provide me the following informations:

Please describe the relationmapping:
SourceColumn3 (any samplesourcedata) --> (CrmAttribute i.e. firstname) CrmAttributeType (i.e. text, picklist, date etc...)
SourceColumn7 (any samplesourcedata) --> (CrmAttribute i.e. lastname) CrmAttributeType (i.e. text, picklist, date etc...)

If possible:
Screenshot of the relationmapping

I require these informations to be able to reproduce it in my system.

Jun 17, 2015 at 2:43 PM

Yes sure here a description:
I've Excel file with:
ID Name Active Type
0114 Stad Gent 0 BD
0233 Maas 0 DE

The field Type is a relation the import tool should find the matching record in CRM and sets the guid, if i'm correct.

So i've the mapping:
primkey: ID (123) -> new_eqt.new_eqtid, text
Name(Stad Gent) -> new_eqt.new_name, text
Active (0) -> new_eqt.statuscode, picklist

Then the relations tab for only 1 field on the crm attribute "new_eqttypeid" (lookup to new_eqttype):
Type(BD) -> new_eqttype.new_name (text)

Jun 17, 2015 at 5:56 PM
Hi Erik,

you're right, there was an issue... should have run the unit tests :-/
Anyway it is fixed now. Please let me know, if it works for you?

Jun 17, 2015 at 8:29 PM
Hi Peter,
Thanks for the quick response! yes unit tests.. you have them, that's the biggest step ;)
Can you create a downloadable version for the new version? I will test it asap!
Jun 18, 2015 at 8:44 PM
Hi Erik,

sorry for the late reply. I was not able to upload a working version to codeplex :-/

Please find the latest version here:

Nonetheless, please let me know, if it worked for you.
I'm looking for someone giving feedback to me and requesting features. Would you be interested?

Jun 24, 2015 at 8:50 AM
Hi Peter,

Thank you for the update, updating/creating the relations works now! Great!
Yes sure i'm interested to give feedback..