Developer forum

Forum » CMS - Standard features » GetUserById - is that a thing?

GetUserById - is that a thing?

Siv-Renate Hansen
Siv-Renate Hansen
Reply

I want to retrieve an address in the checkout process based on a value in the CustomerID field in the user. For example user sivha is connected to customer 10547 through customerID field. Is it possible to retrieve information about customer 10547 when logged in as sivha? (a function like GetUserByID)


Replies

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply
This post has been marked as an answer

Hi Siv,

 

Yes, you can do sometihng like:

  • User user = Dynamicweb.Security.UserManagement.User.GetUserByID( {the user id} )

 

Then the addresses should be available as a list

  • forearch (Address address in user.Addresses) { ... }

 

Best Regards,

Nuno Aguiar

Votes for this answer: 1

 

You must be logged in to post in the forum