Developer forum

Forum » Dynamicweb 10 » Connect Addresses with Users in BC integration

Connect Addresses with Users in BC integration

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I am trying to import some addresses from BC and connect them to the right users.
I cannot use the standard scenario from the BC Blueprint, and I have received a dedicated endpoint from the BC partner.
The endpoint only contains CustomerNumber information for each address. Do I have any built-in option to connect the addresses to the right User just based on the CustomerNumber, or do I have to use  TableScripting? I have noticed a few more options in the Scripting section of the column mapping, and I want to be sure that I won't reinvent the wheel.

Thank you,
Adrian


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Adrian,

Have you considered staging tables as described in detail by Lars? https://doc.dynamicweb.com/community/devblog/blog/alternatives-to-applying-code-in-you-integration-flow?PID=8967

In summary, you would:

1. Import from BC into a temp table that stores the customer number and address data.

2. Create a view that joins data from that temp table and AccessUser to convert the CustomerNumber into an AccessUserId which you can use to bind the address.

3. Then create a second job that reads from the view and imports into AccessUserAddress.

BTYW, is CustomerNumber unique or can multiple users have the same CustomerNumber and therefore the same set of addresses?

Imar

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Adrian,

 

I can answer that :) Short answer is "yes"

 

I just said something about it in https://doc.dynamicweb.com/forum/development?ThreadID=99415. There is a new way to get the addresses by CustomerNumber. And considering Accounts/Customers as User Groups, you can set the address on the user group, and then avoid a lot of duplicate data.

 

The thread talks more about the usage of Profiles in DW, and how introducing 2 user types (Logins vs Profiles) and having a Profile for each Account, will help solve an conflict we've been having over the past few years with "Impersonation" and projects with thousands of B2B customers, particularly when multiple people manage an account (now would be multiple profiles of different Logins under the same account) and some people manage more than 1 account (now would be multiple Profiles of the same Login, one on each Account)

 

This new way of ensuring 1 Profile only belongs to 1 Account (despite 1 Account being able to have multiple Profiles and 1 Login being able to have multiple Profiles) seems to be much more flexible, without conflicting with other features of DW (that at least would put us in a catch-22 situation such as before)

 

Best Regards,

Nuno Aguiar

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

Thank you both very much for the prompt responses. Both are valid approaches; I just need to figure out the best path.
@Imar, while I was writing the question, I asked myself the same question about Customer number uniqueness, but I don't have an answer yet.
I will have to analyse the data first and then decide how I move forward.
But it's good that I have options :)

Thank you very much,
Adrian

 

You must be logged in to post in the forum