• Radhika Bansal
  • NEWBIE
  • 0 Points
  • Member since 2014
  • Salesforce Developer
  • Accenture


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies
I want to query to return more than 10,000 records and also do pagination. In my code we are using Database.getQueryLocator to query. 
The query is like 'Select Id from workorder where recordtype.name ='xyz' LIMIT 5000'

I debugged and found the query when used in Database.getQueryLocator, removes LIMIT keyword 
 for example 
query is >>SELECT Id,AIW_Activity_ID__c ,(Select Id, ParentId, Type, Title, Body, CommentCount,CreatedBy.Name, LikeCount, LinkUrl, RelatedRecordId From Feeds order by CreatedDate DESC LIMIT 5) FROM WorkOrder WHERE RecordTypeId = '0121l00000055y6AAA'  LIMIT 50000

but in database,getquerylocator it is - Aggregations:1|SELECT Id,AIW_Activity_ID__c ,(Select Id, ParentId, Type, Title, Body, CommentCount,CreatedBy.Name, LikeCount, LinkUrl, RelatedRecordId From Feeds order by CreatedDate DESC LIMIT 5) FROM WorkOrder 

Due to removal of  LIMIT keyword I am getting an error - System.LimitException: Too many query locator rows: 10001

I read that if we use database.getQueryLocator we can overlook the governor limit, but I guess that happens only when we use it in a  batch class.

Any idea how I can implement pagination with more than 10,000 records OR apply LIMIT clause in database.getQueryLocator.

The sample code is as below 
 System.debug('query is >>'+ query);
        Database.QueryLocator q = Database.getQueryLocator(this.query);
        this.dataIterator = q.iterator();
        return this;

 
Hi,

I am not able to show selected result whereas when All types is selected, all pictures get displayed.
I debugged and found that the result are present in apex class as the respective boattype id is also fetched correctly. Can someone help me out on this
Below is my code snippet
BoatSearchResults.apx
public class BoatSearchResults {
    @AuraEnabled
    public static List<Boat__c> getBoats(String boatTypeId){        
        List<Boat__c> selectedboats = new List<Boat__c>();
        if(boatTypeId != ''){
            return [Select ID, Name, BoatType__c,BoatType__r.Name, contact__r.Name, Geolocation__c, Picture__c from Boat__c where BoatType__c = :boatTypeId];
        }
        else{
            return [Select ID, Name, BoatType__c,  Picture__c from Boat__c ];
        }
    }
}
BoatSearchResultHelper.js

({
    onSearch : function(component) {
        console.log('here1'+component.get("v.boatTypeId"));
        var action = component.get("c.getBoats");
        action.setParams({
            boatTypeId : component.get("v.boatTypeId")
        });
        action.setCallback(this, function(response){
           console.log('returned value' + response.getReturnValue()); 
            var state = response.getState();
            console.log('state'+state);
               if (state === "SUCCESS") {
                     component.set("v.boats", response.getReturnValue());
               }
            if(state === "ERROR"){
                console.log('error'+ response.getError());
            }
            
        });
        $A.enqueueAction(action);
    }
})

When displayed error it shows - "An internal server error has occurred Error ID: 680922774-129075 (-479172012)"
 
Hi All,

Has anyone ever had a chance to write a test class for Wave.QueryBuilder?
The code that needs to get covered is written below
ConnectApi.LiteralJson result = Wave.QueryBuilder.load(datasetId,datasetCurrentVersionId)
            .filter('\'NAME_PERNR\' in [' + queryNAME_PERNR + ']')
            .filter('date(\'FISCAL_MONTH_END_Year\', \'FISCAL_MONTH_END_Month\', \'FISCAL_MONTH_END_Day\') in [dateRange([' + queryFISCAL_MONTH_END + '], [' + queryFISCAL_MONTH_END + '])]')
            .foreach(projs)
            .execute('q');
 
I have a wave dashboard with a filter in it. I am using wave:selectionChanged to catch the filter selection value. The issue is wave:selectionChanged event is getting fired on page load itself. Because of which when a user clicks on "Update" button without selecting any value then my conditional error is not coming because there is no change in selection.
My concern is how can be sure that the event wave:selectionChanged is fired only when "Update" method is clicked and not on page load.
Hi,

I am not able to show selected result whereas when All types is selected, all pictures get displayed.
I debugged and found that the result are present in apex class as the respective boattype id is also fetched correctly. Can someone help me out on this
Below is my code snippet
BoatSearchResults.apx
public class BoatSearchResults {
    @AuraEnabled
    public static List<Boat__c> getBoats(String boatTypeId){        
        List<Boat__c> selectedboats = new List<Boat__c>();
        if(boatTypeId != ''){
            return [Select ID, Name, BoatType__c,BoatType__r.Name, contact__r.Name, Geolocation__c, Picture__c from Boat__c where BoatType__c = :boatTypeId];
        }
        else{
            return [Select ID, Name, BoatType__c,  Picture__c from Boat__c ];
        }
    }
}
BoatSearchResultHelper.js

({
    onSearch : function(component) {
        console.log('here1'+component.get("v.boatTypeId"));
        var action = component.get("c.getBoats");
        action.setParams({
            boatTypeId : component.get("v.boatTypeId")
        });
        action.setCallback(this, function(response){
           console.log('returned value' + response.getReturnValue()); 
            var state = response.getState();
            console.log('state'+state);
               if (state === "SUCCESS") {
                     component.set("v.boats", response.getReturnValue());
               }
            if(state === "ERROR"){
                console.log('error'+ response.getError());
            }
            
        });
        $A.enqueueAction(action);
    }
})

When displayed error it shows - "An internal server error has occurred Error ID: 680922774-129075 (-479172012)"
 
Has anybody tried out integrating Google Charts to Lightning Components?

I am getting the following error while doing direct way of loading the jsapi in static resource and loading other packages in the google way(loading throught script as in the default google example).
User-added image

Also tried loading all the the resources referenced in script one by one to static resource and added using ltng:require, still did no good.

Please help if somebody has done it.
I have a lightning component from which I am retrieving contact records onto an aura:attribute which is as follows:
<aura:attribute name="data" type="Contact[]"/>    

after retrieving the result from the controller I am printing it on component using aura:iteration which is as follows:

<aura:iteration items="{!v.data}" var="data">        
            <tr>
                <td><a href="{! '#/sObject/' + data.Id +'/view'}" onmouseover="{!c.mouseOver}">
                    <p>{!data.Name}</p></a></td>
                <td><a href="{! '#/sObject/' + data.Id +'/view'}">
                    <p>{!data.Phone}</p></a></td>
                <td><a href="{! '#/sObject/' + data.Id +'/view'}">
                    <p>{!data.CreatedDate}</p></a></td>                
            </tr>
        </aura:iteration>

As you can see on the first <td> tag I have used mouseover from where I am calling a js controller method ...

I want that method to be looked like this:

mouseOver : function(component, data){
        console.log('data = '+ data);
    }

now the 'data' argument I want to pass while the method is called i.e., mouse is hovered on that <td> and the data should be the name i.e., "{!data.name}"

where 'data' is the 'var' for the aura:iteration..

So how to send argument to js controller from component while calling from there only....

please help me its urgent