You need to sign in to do that
Don't have an account?
Jake Backues
how can i make an array of an array of objects in apex
My org has decided to use arrays over lists to reduce our overall code. We have a large amount of it. I have a SOSL query that returns and array of an array of SObjects. How can i use arrays instead of lists for the return value?
I get errors when doing this
I get errors when doing this
SObject[][] searchList = [ FIND :query IN ALL FIELDS RETURNING Opportunity(Id, Name WHERE RecordType.Name In :recordTypeNames, Service__c(Id, Name WHERE RecordType.Name In :recordTypeNames AND Status__c IN :serviceStatuses) ];
refer: https://www.tutorialspoint.com/apex/apex_arrays.htm
Here i attach a link to use sosl in salesforce: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dynamic_sosl.htm
Please mark this as best answer if your problem is solved.
yes they are the same, and I understand how to use SOSL and Arrays individually. Can you show me an example of using arrays to capture the results of a SOSL Query? or the syntax of an array of an array. For example the list would be:
List<List<SObject>>()
But SObject[][] does not work. what is that syntax?
The following example exercises a simple SOSL query string. Hope this has helped you.
Thanks,
Gulafsha
Please use arrays to accept the return value of the sosl query.