1

I am writing a SOAP WS in salesforce to return data from multiple objects

global class TXLIDAWS {

webservice static List<DataWrapper> GettxlidaData(){
    List<DataWrapper> dataWrapperList = new List<DataWrapper>();
    Set<Id> includedFindingReviews = new Set<Id>();

    //from QC review finding, query all Parent object, get Data, make a wrapper class and return
    for(QC_Review_Finding__c QC : [select id,Weighting__c,comments__c,QC_Review_Criterion__c,QC_Review_Finding_Section__c,QC_Review_Finding_Section__r.QC_Review__r.Application_Number__c,QC_Review_Finding_Section__r.QC_Review__r.Final_Reviewer__r.Name,QC_Review_Finding_Section__r.QC_Review__r.Initial_Reviewer__r.Name,QC_Review_Finding_Section__r.QC_Review__r.Program__c,QC_Review_Criterion__r.Case_Development_Section__c,QC_Review_Criterion__r.QC_Review_Section__r.Section_Number__c from QC_Review_Finding__c where QC_Review_Finding_Section__r.QC_Review__r.Program__c='TX LIDA' LIMIT 50000]){
        DataWrapper wrapper = new DataWrapper();
        wrapper.applicationNo = QC.QC_Review_Finding_Section__r.QC_Review__r.Application_Number__c;
        wrapper.finalReviewer  = QC.QC_Review_Finding_Section__r.QC_Review__r.Final_Reviewer__r.Name;
        wrapper.initialReviewer  = QC.QC_Review_Finding_Section__r.QC_Review__r.Initial_Reviewer__r.Name;
        wrapper.comments = QC.Comments__c;
        wrapper.weighting = QC.Weighting__c;
        wrapper.casedevelopmentsection = QC.QC_Review_Criterion__r.Case_Development_Section__c;
        wrapper.sectionNo = QC.QC_Review_Criterion__r.QC_Review_Section__r.Section_Number__c;
        dataWrapperList.add(wrapper);

        includedFindingReviews.add(QC.QC_Review_Finding_Section__r.QC_Review__c);
    }

    //if any QC review does not have child, get its data also.
    for(QC_Review__c QC : [select id,Application_Number__c,Final_Reviewer__r.Name,Initial_Review_Complete_Date__c,Initial_Reviewer__r.Name,Final_Review_Complete_Date__c from QC_Review__c where Program__c='TX LIDA' and Id NOT IN :includedFindingReviews]){
        DataWrapper wrapper = new DataWrapper();
        wrapper.applicationNo = QC.Application_Number__c;
        wrapper.finalReviewer  = QC.Final_Reviewer__r.Name;
        wrapper.initialReviewer  = QC.Initial_Reviewer__r.Name;
        dataWrapperList.add(wrapper);
    }
    return dataWrapperList;
}

global class DataWrapper{
    webService String initialReviewer;
    webService String finalReviewer;
    webService String applicationNo;
    webService String comments;
    webService Decimal weighting;
    webService String casedevelopmentsection;
    webService Decimal sectionNo;
}

}

Now if the reocrds in less than 50K then its works fine. But i Have around 300k records. How can i return them using this WS??

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.