function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Abhilash Mishra 13Abhilash Mishra 13 

checking login is successful before redirecting to starturl and retrieve userid

I have and object where i need to update a field user_info__C with the customer portal userid. before redirecting to the start url.

by any means can i retrieve user id before redirection if login is successful.

Thanks
Abhilash Mishra

Rahul SharmaRahul Sharma
Try giving the community user's Profile(Customer Community Profile which is the profile of community's Guest user - this profile is attached to your Force.com Sites created by Creating Community) access of the Object and Field.
Now try runing your class which has login logic in system mode(using without sharing keyword).
See by above if you are able to access the table.
Abhilash Mishra 13Abhilash Mishra 13
Hi Rahul it's not working. is any way i can confirm login is successful just after site.login(username , password, starturl) is invoked and update some recods,
Rahul SharmaRahul Sharma
You can check with adding system.debugs and Check the debug log for site/guest user.