This project has moved and is read-only. For the latest updates, please go here.

Geocode Address not working

Sep 14, 2016 at 3:16 PM
Hello, we are testing with the geocode address activity. Unfortunately it returns an error:, but no specific details. As a last resort we tried with a static address in the workflow, but no luck. When calling the url directly with the Bing Key (http://dev.virtualearth.net/REST/v1/Locations...) it works.

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Unexpected exception from plug-in (Execute): msdyncrmWorkflowTools.GeoCodeAddress: System.NullReferenceException: Object reference not set to an instance of an object.Detail:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
<ErrorCode>-2147220891</ErrorCode>
<ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
<KeyValuePairOfstringanyType>
  <d2p1:key>OperationStatus</d2p1:key>
  <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">0</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
  <d2p1:key>SubErrorCode</d2p1:key>
  <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">-2146233088</d2p1:value>
</KeyValuePairOfstringanyType>
</ErrorDetails>
<Message>Unexpected exception from plug-in (Execute): msdyncrmWorkflowTools.GeoCodeAddress: System.NullReferenceException: Object reference not set to an instance of an object.</Message>
<Timestamp>2016-09-14T13:42:35.5652776Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText>

[Microsoft.Crm.ObjectModel: Microsoft.Crm.ObjectModel.SyncWorkflowExecutionPlugin]
[50b89b05-817a-e611-80e5-c4346bac4838: ]
Starting sync workflow 'Test', Id: 48b89b05-817a-e611-80e5-c4346bac4838
Entering CustomActivityStep1_step:
Sync workflow 'Test' terminated with error 'Unexpected exception from plug-in (Execute): msdyncrmWorkflowTools.GeoCodeAddress: System.NullReferenceException: Object reference not set to an instance of an object.'

</TraceText>
</OrganizationServiceFault>
Oct 28, 2016 at 10:47 AM
Edited Oct 28, 2016 at 10:47 AM
I've done some testing on this and I did get it to work however it's not robust enough to use in a workflow for address Geo-coding yet in my opinion.

What I did is construct a calculated text field that contains the address with commas in.

eg. 1 Street, Town, Postal Code

This can then be passed into the workflow and the Geocoding succeeds and passed back the long/lat.

The failure of the workflow seems to come about where Bing Maps cannot resolve the address. It would be better if this was trapped by the Geo-code action rather than a failure.

This mean that if the address is not resolvable you set Long and Lat back to blank and notify the user.

It needs more work but it is something that I would be very interested to use once it is enhanced.

Thanks for the work do far on this.
Coordinator
Nov 13, 2016 at 10:41 PM
Thank you both for the feedback.
I'll try it again in oreder to make it better ;)

regards!
Coordinator
Nov 18, 2016 at 10:18 PM
Solved today ;)
Nov 21, 2016 at 12:03 PM
Thanks you all. I will give it a try once I have the time!
Coordinator
Dec 6, 2016 at 11:15 AM
Thanks Cobelens! hope now works fine ;)