Hi
I am getting Error :
SOQL currently not allowed
My code is :
at line number 47 i am getting Error
Error : System.LimitException: SOQL currently not allowed
please Help me
Thank you
#Trailhead Challenges #Salesforce Developer #Certifications #Security #Analytics
1 answer
Eric Burté (DEVOTEAM) Forum Ambassador
Hello @ANJALI Anjali
have you tried to do it in 2 steps, or with parenthesis..
See the 2 options below & the associated log result :
//Most common
Organization oid = [Select Id, isSandbox from Organization Limit 1];
Boolean isMyOrgASandbox = oid.isSandbox;
System.debug(isMyOrgASandbox);
//One line shorter
Boolean isMyOrgASandboxBis = ([Select Id, isSandbox from Organization Limit 1])?.isSandbox;
System.debug(isMyOrgASandboxBis);
And the result in log
Eric