You need to sign in to do that
Don't have an account?
Terminusbot
Apex List: SOQL query Question
I am trying to get a string value off the User object. When I run a debug it is returning not only the Sagitta_User_Code__C, but the ID as well. I just want to get the Sagitta_User_Code__c. How do I isolate just the value of the Sagitta_User_Code__c.
Debug Log:
List<User> accountOwner = [Select Sagitta_User_Code__c From User where id =: accnt.ownerid]; System.debug('Sagitta Login: ' + '' + accountOwner);
Debug Log:
|USER_DEBUG|[22]|DEBUG|Sagitta Login: User:{Sagitta_User_Code__c=ral, Id=005400000032HgHAAU}
for directly accessing field valu of a particular record in accountOwner List
use:
Mark this as Best Answer, if this helps solve your problem.
All Answers
for directly accessing field valu of a particular record in accountOwner List
use:
Mark this as Best Answer, if this helps solve your problem.
Not sure what the [5] was referencing.
Thanks,
Ricky
[5] represents the index. It gives value of 6th record in the list accountOwner, if the list has 6 or more records.
The index can range from 0 to N-1, where N is the size of list acccountOwner.