avs099
avs099

Reputation: 11227

Kentico BizForm API - how to create that form "anonymously" from the backend with logged-in user?

We have an existing Kentico-driven site. On top of that site, we created a user-friendly app to allow managers to enter data into Kentico database. Essentially we are using Kentico API from our backend code to creating a BizForm object in Kentico. The problem I'm facing is that when managers enter information on our site, everything is done in the context of MANAGER - and therefore Kentico updates manager's contact information with CUSTOMER information they just entered.

Here is what happens:

  1. Manager John has USER account in Kentico.
  2. He logs in into our app. We call AuthenticationHelper.AuthenticateUser() for him, and set a cookie. Every API is protected with [Autorize] attribute
  3. Then he fills in information for Susie (a customer) and we call BizFormInfoProvider.GetBizFormInfo().Insert() to create new form object in Kentico.
  4. Form is created - but John's contact info (in OM_Contact table) in Kentico is updated and becomes Susie's info.

I guess I either need to tell Kentico to create BizForm anonymously (and it will match email on the form to a contact, if exists), or I need to tell Kentico to disable automatic "matching" of form and contact - but I was not able to figure out how to do that. Or may be there is another way?

we have Kentico 11 and use it with .net API

Upvotes: 0

Views: 252

Answers (1)

Dmitry Bastron
Dmitry Bastron

Reputation: 694

It must be a Contact Mapping configured for form (refer to Kentico docs). To disable this behavior, you just need to remove this mapping from Form configuration. Or it might be enough just to untick "Override" checkbox.

Upvotes: 2

Related Questions