Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
246 views
in Technique[技术] by (71.8m points)

Kentico - Duplicate contacts getting created

We are working on Kentico 10.

We import contacts provided to us as CSV (saving in OM_Contact table).

Then our system sends emails to these users, they come to our website and register themselves.

The problem is that we are seeing duplicate contacts (not users) getting generated.

It looks like the first contact is created when we imported and second when user is registered (which also creates contact).

How can we make sure user registration associates the user to existing contact and not creating a new contact.

The code to create user is something like this:

UserInfo user = new UserInfo();

user.set ... ....

UserInfoProvider.SetUserInfo(user); 
UserInfoProvider.AddUserToSite(user.Email, SiteContext.CurrentSiteName);

Thanks

question from:https://stackoverflow.com/questions/65943400/kentico-duplicate-contacts-getting-created

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I'd highly recommend importing those contacts through the Kentico UI vs. writing code or importing directly into the database table. In v10 there isn't much for duplicate checking but you can use the Merge tool to merge 2 contacts together.

Also, you need to be sure what you're talking about. You reference the OM_Contact table. This is a contact. Then you showed code pointing at the UserInfoProvider. This is a user account, someone who would log into a site. A user can be tied to a contact via the ContactUserID field in the OM_Contact table. So maybe having a better understanding of exactly what you're talking about would be the first step.

Duplicate question posted directly on Kentico's DevNet here.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...