• satish kopuri
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Hi All , 

I am trying to disaplay  External Object Records on VisualForce page through Salesforce Connect: OData 2.0.(I have configured this External data Source).Then I tried to query records from External Object.For 200 records I am able to show the records but for more than 200 records I am getting below error.


System.QueryException: Inline query has too many rows for direct assignment, use FOR loop
 please help me to resolve this issue.

Please find the below code snippet.

    Public List<GetBooks__x> getbookslist  { get; set; }

getbookslist= [SELECT ExternalId, BookName__c, BookFeature__c  from GetBooks__x
                                                     WHERE BusinessPartner__c =:currentRecord.Partner_Number__c ];

If I put LIMIT 200 , I am getting 200 records to display  , for more that 200 I am getting the above error.


            
When I am saving the record I am getting error like :
Uncaught Action failed: c:CaseCreation$controller$handleSubmit [Cannot read property 'submit' of undefined]

Hi ,

I have been displaying the some fields dynamically using aura iteration and lightning inputfields.After entering the values , how should I capture the  entire fields values and save it to the data base.

here is my code.:
Component:
<aura:component controller="CaseLgtController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,lightning:actionOverride,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
    
    
    <aura:attribute name="CaseFieldslist" type="Map" />
    <aura:attribute name="newCase" type="Case" />
    
    <article class="slds-card">
        <div class="slds-section slds-is-open" >
            <h3 class="slds-section__title slds-theme_shade">
                <span class="slds-truncate" title="Section Title">Case Type Details</span>
            </h3>
        </div>  
        
        <lightning:recordEditForm aura:id="recordEditForm"
                                  onsubmit="{!c.handleSubmit}"
                                  recordTypeId="012900000012NI9"
                                  onsuccess="{!c.handleSuccess}"     
                                  objectApiName="Case">
            <!-- the messages component is for error messages -->
            <lightning:messages />
            <lightning:layout multipleRows="true">
                <lightning:layoutItem flexibility="auto" padding="around-small">
                    <div class="custom-box"><lightning:inputField fieldName="Type" value="{!v.newCase.Type}"  /></div>
                </lightning:layoutItem>
                
                <lightning:layoutItem flexibility="auto" padding="around-small">
                    <div class="custom-box"> <lightning:inputField fieldName="Sub_Type__c" value="{!v.newCase.Sub_Type__c}"  /></div>
                </lightning:layoutItem>
                <lightning:layoutItem flexibility="auto" padding="around-small">
                    <div class="custom-box"> <lightning:inputField aura:id="CaseDetail" fieldName="Case_Detail__c" onchange="{!c.casedetailsSelected}"   /></div>
                </lightning:layoutItem>
            </lightning:layout>
            
            
            <div class="slds-section slds-is-open" >
                <h3 class="slds-section__title slds-theme_shade">
                    <span class="slds-truncate" title="Section Title">Mandatory Fields</span>
                </h3>
            </div>  
            
            <div class="slds-grid slds-wrap slds-gutters" >
                
                <aura:iteration items="{!v.CaseFieldslist}" var="item" indexVar="indx">
                    <lightning:layoutItem flexibility="auto" padding="around-large" >
                        
                        <div class="custom-box"> <lightning:inputField fieldName="{!item.value}" aura:id="CaseFieldsAPI"   /> </div>
                    </lightning:layoutItem>
                    
                    
                </aura:iteration>
                
            </div>
            <div class="slds-m-top_medium">
                <lightning:button disabled="{!v.disabled}" variant="brand" type="submit" name="save" label="Save" />
            </div>
        </lightning:recordEditForm>
        
        
        
        
    </article>
</aura:component>

Js Controller:

({
    casedetailsSelected:function(component, event, helper) {
       
        var casedetailvalue =component.find("CaseDetail").get("v.value");
        //alert("case detail value--" +casedetailvalue)
    
        var action = component.get("c.MandatoryFieldsFetchById");
       
        action.setParams({"caseId" : casedetailvalue
                          
                         });
        action.setCallback(this, function(response) {
            var state = response.getState();
            var conts = response.getReturnValue();
            console.log(conts);
            //console.log(conts.length);
            console.log(state);
            // alert(state);
            if (state === "SUCCESS") {      
                var custs = [];
                var conts = response.getReturnValue();
                
                for(var key in conts){
                    custs.push({value:conts[key], key:key});
                }
                component.set("v.CaseFieldslist", custs);
                
            } 
            
            
        });           
        $A.enqueueAction(action);        
    
    },
    handleSubmit: function(component, event, helper) {
           event.preventDefault();       // stop the form from submitting
            var fields = event.getParam('fields');
            fields.Subject = '32 Prince Street';
            component.find('myRecordForm').submit(fields);
        },
    
    handleSuccess : function(component, event, helper) {
        var payload = event.getParams().response;
        console.log(payload.id);
    }
    
})

 
Hi All , 

I am trying to disaplay  External Object Records on VisualForce page through Salesforce Connect: OData 2.0.(I have configured this External data Source).Then I tried to query records from External Object.For 200 records I am able to show the records but for more than 200 records I am getting below error.


System.QueryException: Inline query has too many rows for direct assignment, use FOR loop
 please help me to resolve this issue.

Please find the below code snippet.

    Public List<GetBooks__x> getbookslist  { get; set; }

getbookslist= [SELECT ExternalId, BookName__c, BookFeature__c  from GetBooks__x
                                                     WHERE BusinessPartner__c =:currentRecord.Partner_Number__c ];

If I put LIMIT 200 , I am getting 200 records to display  , for more that 200 I am getting the above error.