Developer forum

Forum » Integration » Import users from Business Central

Import users from Business Central

Tomas Gomez
Reply

Hi,

We have an integration from an OnPrem BC14 to DW9.13. To import the users we use an scheduled task calling a web service with the request:

<GetEcomData><tables><Customers type="all" importSalesPeople="true" /></tables></GetEcomData>

The response doesn't contain all BC customers, there are missing customers. We cannot ascertain the pattern of why some customers are imported and some others not. All of them are valid customers in BC.

How can we integrate all the customers? Is there any parameter we should use to get all customers? (similar to importSalesPeople="true")  Should the BC customers fulfill any requirements to be imported? (e.g. certain data cannot be empty, belonging to special groups)

Regards,
Tomas

 

 

 


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Tomas,
try to add this parameter:
importContacts="false"
You can read more about this request here.
BR, Dmitrij

 
Tomas Gomez
Reply

Hi Dmitrij,

Thanks for the prompt response, that was the key :-) 

Actually we tried in advancebut only importContacts="true". We didn't expect that importContacts="false" would import more customers, maybe the name of the parameter is confusing.

Another issue is that we got error importing the values of AccessUserAddress > AccessUserAddressCell

Error: The given value of type String from the data source cannot be converted to type nvarchar of the specified target column.

The data is 

<column columnName="AccessUserAddressCell"><![CDATA[022378058 / 0984409808]]></column>
<column columnName="AccessUserAddressPhoneBusiness"><![CDATA[022378058 / 0984409808]]></column>

Both AccessUserAddressCell and AccessUserAddressPhoneBusiness have the same format, but only AccessUserAddressCell triggers the error. There is no error when disabling AccessUserAddressCell in the data integration job (see image)

Is this a normal behaviour? Does AccessUserAddressCell require a special format? 

Regards,
Tomas

 

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

No it doesn't require the special formatting.
Maybe you get a too long string from BC that can not be inserted into the AccessUserAddress AccessUserAdressCell column.
This columns default length should be 255.
So you can try to increase the allowed values length using the sql like that:
ALTER TABLE AccessUserAddress ALTER COLUMN AccessUserAddressCell [nvarchar](500) NULL;

 
Tomas Gomez
Reply

Hi Dmitriy,

We expanded the column per your suggestion but the issue is not solved.

We did more testing and you are right pointing the length as the reason. We found that other columns has no this issue with whatever data length. In the AccessUserAddressCell we tried:

  • Test A (Accepted): <column columnName="AccessUserAddressCell"><![CDATA[022378058 / 09844098]]></column>
  • Test B (Exception): <column columnName="AccessUserAddressCell"><![CDATA[022378058 / 0984409808]]></column>

The AccessUserAddressCell size is long enough now (we expanded it to 1000), so it looks like the reader of the JSON has a limit for the length of AccessUserAddressCell.

Could this be the reason of the issue? How could we fix it?

Regards,
Tomas

 

 

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Tomas,
what is your destination data integration provider?
BR, Dmitrij

 
Tomas Gomez
Reply

Hi Dmitrij,

The data integration activity has a XML source provider and a User destination provider

 
Tomas Gomez
Reply

Hi Dmitrij,

Any news about this issue?

Regards,
tomas

 

You must be logged in to post in the forum