sazr
sazr

Reputation: 25928

Creating Users without logging them in?

How can I create a new user in the webstore/Netsuite but not log them in? session.registerGuest() and session.registerCustomer() will both login the user aswell as create a new user.

In my case I only want the user created. Heres the usecase: we sell medical tests. Upon purchase of a test we create a user for the patient (who is most likely not the purchasee). So I need to create a new user, I was hoping to just use session.registerGuest() but that logs in the new patient and logs out the purchaser/customer.

Any ideas how best to create a user (and not cause headaches down the track)? I could just create a new record in Customer but I'm adverse to doing this because I may not set all the necessary fields which could cause headaches down the track when/if that patient consolidates to a fully fledged customer. Creating the patient as a custom entity (ie, outside the Customer table) isn't the way to go because they could eventually become Customers so I'll need to consolidate, associate orders(tests) and etc.

If I go the path of creating a new user record, any advice on what essential customer columns/fields I should set?

Upvotes: 1

Views: 83

Answers (1)

bknights
bknights

Reputation: 15367

This can actually be quite minimal. You need a name. You can do this easily via a Suitelet.

Of course if you are going to turn the customer record into an actual customer down the road you need to set enough information that you can retrieve the record otherwise creating it in the first place is pointless.

So in addition to the name you need to think how would you link the placeholder to a real person who is willing to offer some identity.

A possible value add is to include some information that identifies the original customer creator or an associated product so you can track revenue or get some sense of campaign success if the placeholder becomes a customer.

If you are doing this work as a contractor you should of course find out from your customer what there minimal requirements are. Perhaps you should create the customer record as a prospect or a lead instead of as a customer.

Upvotes: 1

Related Questions