We are looking into using the Customer Center. Is ...
# suitescript
s
We are looking into using the Customer Center. Is there a way to get the current customer that is logged in?
j
Use the N/runtime module and the function runtime.getCurrentUser() will return the user currently logged in. https://suiteanswers.custhelp.com/app/answers/detail/a_id/45166/loc/en_US
❤️ 1
m
Note that in the customer center (assuming I'm remember correctly),
currentUser.id
will give you the customer's ID (i.e. from the company); if you're looking for the ID of the specific contact that's logged in, I believe you can get that from
currentUser.contact
.
❤️ 1