Skip to main content
Neha Patil fragte in #Apex
Hi all,

I have six queries and i would want to retrieve the data by merging those queries into a single one . How can this be done?

retrieveUserProfile  -> SELECT Mobile_Configuration_Profile__r.Name, Mobile_Configuration_Profile__r.API_Access__c FROM UserToMobileLink__c WHERE User__c = 'userId’

 

retrieveCurrentUserDetails -> select  Languages__c, User_Sales_Org__c from User where Id = ‘userId’

 

retrieveLocaleObject -> Select Name, Translated_Text__c from Translations__c where Language__c = 'userLocale'

 

retrieveUserProfileSpecification -> select Id, Name, Tab__c ,Create__c, Delete__c,Update__c, SOQL_Data_Filter__c from Mobile_Configuration_Item__c where Mobile_Configuration_Profile__r.Name = 'profileName’ ORDER BY Id.

 
10 Antworten
  1. 26. Juni 2015, 05:53
    Hi...

    Yes we can retrieve data from multiple objects in a single query using SOSl.

     for eg.

    List<List<SObject>> searchList = [FIND 'SFDC' IN ALL FIELDS RETURNING Account(Name), Contact(FirstName,LastName)];

    this query searches for accounts and contacts that have any fields with the word 'SFDC'.

0/9000