I have created a package in salesforce that will make an http callout request with user's email id to get data for that email and add the data to some custom object. But when I tried using
UserInfo.getUserEmail() as a request parameter but it makes a request with
email@example.com. It does work when I run it on the dev account. I also tried using
1.String userName = UserInfo.getUserName(); 2.User activeUser = [Select Email From User where Username = : userName limit 1]; 3.String userEmail = activeUser.Email;
But line no 2 gave me an error saying List has no rows for assignment to SObject
This is my first salesforce package, so any help would be appreciated.