• Gopal Kallepu 3
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi,
I am trying get the details of list of accounts whose Ids are present in an array (of Strings)
Following are my code details :
component code :
<aura:component controller="ApexController" >
    <aura:attribute name="selectedAccountIdsArray" type="String[]"/>
   <aura:attribute name="selectedAccounts" type="Account[]"/>
   Code to iterate on accounte...
</aura:component>
Helper code :
var action = component.get("c.getSelectedAccounts");
        action.setParams({
          "fAccntIds" : component.get("v.accountsToRebal") 
        });
         alert(component.get("v.accountsToRebal") ;);
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (component.isValid() && state === "SUCCESS") {
                component.set("v.selectedAccounts", response.getReturnValue());
            }
Apex code :
@AuraEnabled
    public static List<Account> getSelectedAccounts(List<String> selAccountIds) {
        system.debug('##########################'+ selAccountIds);
        return [SELECT Id,Name FROM Account WHERE Id in : selAccountIds ] ;
    }

But on executing this I am getting following error in debug logs, 
03:53:52.214 (214837802)|EXECUTION_STARTED
03:53:52.214 (214870409)|CODE_UNIT_STARTED|[EXTERNAL]|01p37000002JJaj|ApexController.getSelectedAccounts
03:53:52.215 (215446408)|METHOD_ENTRY|[1]|01p37000002JJaj|ApexController.ApexController()
03:53:52.215 (215459217)|METHOD_EXIT|[1]|ApexController
03:53:52.215 (215616551)|FATAL_ERROR|Internal Salesforce.com Error
03:53:52.215 (215634182)|CUMULATIVE_LIMIT_USAGE
03:53:52.215 (215634182)|LIMIT_USAGE_FOR_NS|(default)|
As the debug statement (######## ) is not being printed, clearly there is some issue with assigning the array of string to List of strings..

How can I solve this issue... ?
Note : We are passing the values of 'selectedAccountIdsArray' from parent component 



 
Hi,
I am trying get the details of list of accounts whose Ids are present in an array (of Strings)
Following are my code details :
component code :
<aura:component controller="ApexController" >
    <aura:attribute name="selectedAccountIdsArray" type="String[]"/>
   <aura:attribute name="selectedAccounts" type="Account[]"/>
   Code to iterate on accounte...
</aura:component>
Helper code :
var action = component.get("c.getSelectedAccounts");
        action.setParams({
          "fAccntIds" : component.get("v.accountsToRebal") 
        });
         alert(component.get("v.accountsToRebal") ;);
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (component.isValid() && state === "SUCCESS") {
                component.set("v.selectedAccounts", response.getReturnValue());
            }
Apex code :
@AuraEnabled
    public static List<Account> getSelectedAccounts(List<String> selAccountIds) {
        system.debug('##########################'+ selAccountIds);
        return [SELECT Id,Name FROM Account WHERE Id in : selAccountIds ] ;
    }

But on executing this I am getting following error in debug logs, 
03:53:52.214 (214837802)|EXECUTION_STARTED
03:53:52.214 (214870409)|CODE_UNIT_STARTED|[EXTERNAL]|01p37000002JJaj|ApexController.getSelectedAccounts
03:53:52.215 (215446408)|METHOD_ENTRY|[1]|01p37000002JJaj|ApexController.ApexController()
03:53:52.215 (215459217)|METHOD_EXIT|[1]|ApexController
03:53:52.215 (215616551)|FATAL_ERROR|Internal Salesforce.com Error
03:53:52.215 (215634182)|CUMULATIVE_LIMIT_USAGE
03:53:52.215 (215634182)|LIMIT_USAGE_FOR_NS|(default)|
As the debug statement (######## ) is not being printed, clearly there is some issue with assigning the array of string to List of strings..

How can I solve this issue... ?
Note : We are passing the values of 'selectedAccountIdsArray' from parent component