Back

SmartConnect Progress Window Shows Double the Expected Record Count

Published: Nov 04, 2024
Post Author Written by Pat Roth

My SmartConnect source has exactly 105 unique records and is going to a Microsoft Dynamics GP (or Business Central, CRM CE, etc.) destination.

When I run the map, The Record Count shows double the Record Count at 210. But the other odd thing in this case, is that the number of Successful + Failed Records is only 105. The other 105 do not seem to be processed.

Why is this happening?


The Record Count that shows in the SmartConnect Progress window for an integration is based on the Data Source Keys.

The Data Source Keys define how SmartConnect should group the source data into one or more “Documents” to be processed as a unit.

236 Record Count is doubled 1

In this example, the DEX_ROW_ID is the unique value of the RM00101 source table and since my source table has 105 rows then my Record Count would expect to be 105 for this example.

However, if I choose “State” as my Data Source Key field – there are multiple that are in the same state and even if the Record Count would show 50 (at least one customer in each US State) – SmartConnect will still process every record in the dataset.

236 Record Count is doubled 2

Running the map, we see that the Record Count is being “doubled” from what we expected to see – but the Error Count + Success Count does equal the Record Count at 210.

The reason why the count is “doubled” is because each destination gets its own “Record Count” from the source.

236 Record Count is doubled 3

Looking at the Companies Destination – we can see that I have 2 companies in this database.

I could mark both of these checkboxes as destinations meaning that both companies would then get the same data from the source and thus would double the 105 source records to 210 Record Count we saw previously.

More typically, what we see is that the “Define” button script is used. Sometimes it is hard coded like this but more often it is set to a source field of the data if the data contains the destination database name in the case of GP.

Something like:

return _INTERID
return _INTERID;

Normally a “Define” script is not used with a checked company database as typically mutually exclusive.

In order to determine if the “Define” script should be evaluated, SmartConnect looks to see if it is set to the default or not. The default is set to:

return string.Empty
   
  
return string.Empty;

   
   

If the value is anything other than that default code, the Define button code is evaluated and the data is sent to whatever the value is in the code – SIX20 in the previous example.

236 Record Count is doubled 5

Here, we have added comments but the actual “code” is the same as the default. But will this affect the result?

236 Record Count is doubled 4

It does. Because we added comments to the Define button code, the actual text of the code is NOT “return string.Empty” and therefore SmartConnect WILL evaluate the define button code. This causes SmartConnect to again allocate the extra 105 “Record Count” for the define code to process. The checked company processes normally and we see the success/fail count for that database – but since we DO return an empty string for each record – those are all skipped since the tenant destination is empty. Due to the records being skipped – they are not counted as a either a success or fail.

While this odd result won’t cause any errors or process “extra” data – the results are puzzling and probably should be avoided.

To resolve this, press the Clear button in the Map Destination Definition window to return to the default code again.

Feeling stuck? Get the support and guidance you need to help you power through any data challenge

We're on your integration team. Connect with our people and let us know how we can help you.