Skip to main content The Trailblazer Community will be unavailable from 2/1/2025 to 2/2/2025. Please plan your activities accordingly.

I have valid soql query returning zero results in apex class but it return expected results in developer console - FYI i have tried to running both context with sharing and without sharing  still no result. any idea 

@InvocableMethod(label='Get User info')

public static List<userOutput> getUserLogedInInfo(List<userInput> inputParameters){

List<userOutput> outputParameters = new List<userOutput>();

userOutput outputParameter = new userOutput();

String sEmail = inputParameters[0].sEmail;

String sContact = null;

String sUser = null;

List <User> userList = [SELECT Id, FirstName, LastName, Email,ContactID FROM USER WHERE Email = :sEmail];

System.debug('⌗⌗⌗⌗⌗⌗ User⌗⌗⌗⌗'+userList);

if (userList.size()>0){

sContact = userList[0].ContactId;

System.debug('⌗⌗⌗⌗⌗⌗ UserId⌗⌗⌗⌗'+ userList[0].Id);

List <AuthSession> auth = [SELECT Id, UsersId, IsCurrent FROM AuthSession WHERE IsCurrent = True AND UsersId = : userList[0].Id LIMIT 1];

System.debug('⌗⌗⌗⌗⌗⌗ auth⌗⌗⌗⌗'+auth);

if (auth.size()>0){

System.debug('i am here'+ outputParameter.sLogin);

outputParameter.sLogin = True;

}

}

outputParameters.add(outputParameter);

return outputParameters;

}

 
3 answers
Loading
0/9000