• Abirami K 9
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
When keying sfdx from cmd or from the VS Code Terminal, I am getting the error: 'sfdx' is not recognized as an internal or external command, operable program or batch file.

Any clue on how to fix this?
 
  • March 08, 2019
  • Like
  • 0
Hi,
The snippet below is from an Apex Class I have. In production, it works great. I use my list AccountsinBatch to limit the results of other queries in my class, which is great.

Only problem is that it doesn't work in my test class! The last line 
List<Account> AccountsinBatch = [SELECT ID FROM Account WHERE ID IN :AccountBatch limit :accountlimit];
 returns 0 rows. If I remove the "...ID IN :AccountBatch..." part the test class gets data. 

I don't think the problem is that AccountBatch is empty since I can see Apex interates through, adding to it. 

So why does the bind break in test class, but not prod?

Any help would be apprecaited,
James
03:11:55.340 (3340851502)|SYSTEM_METHOD_ENTRY|[183]|List<Id>.add(Object)
03:11:55.340 (3340857975)|ENTERING_MANAGED_PKG|
03:11:55.340 (3340867547)|SYSTEM_METHOD_EXIT|[183]|List<Id>.add(Object)
03:11:55.340 (3340874331)|SYSTEM_METHOD_ENTRY|[181]|system.ListIterator.hasNext()
03:11:55.340 (3340884287)|SYSTEM_METHOD_EXIT|[181]|system.ListIterator.hasNext()
03:11:55.340 (3340914907)|SYSTEM_METHOD_ENTRY|[183]|List<Id>.add(Object)
03:11:55.340 (3340921200)|ENTERING_MANAGED_PKG|
03:11:55.340 (3340930410)|SYSTEM_METHOD_EXIT|[183]|List<Id>.add(Object)
03:11:55.340 (3340937140)|SYSTEM_METHOD_ENTRY|[181]|system.ListIterator.hasNext()
03:11:55.340 (3340947018)|SYSTEM_METHOD_EXIT|[181]|system.ListIterator.hasNext()
03:11:55.340 (3340961044)|SYSTEM_METHOD_ENTRY|[185]|TaxReceiptsNPSP__ReceiptSettings__c.getInstance(String)
03:11:55.340 (3340966823)|ENTERING_MANAGED_PKG|
03:11:55.341 (3341067464)|SYSTEM_METHOD_EXIT|[185]|TaxReceiptsNPSP__ReceiptSettings__c.getInstance(String)
03:11:55.341 (3341099837)|SYSTEM_METHOD_ENTRY|[185]|Integer.valueOf(Object)
03:11:55.341 (3341107019)|ENTERING_MANAGED_PKG|
03:11:55.341 (3341134335)|SYSTEM_METHOD_EXIT|[185]|Integer.valueOf(Object)
03:11:55.341 (3341319181)|SOQL_EXECUTE_BEGIN|[186]|Aggregations:0|SELECT ID FROM Account WHERE ID IN :tmpVar1 LIMIT :tmpVar2
03:11:55.343 (3343319950)|SOQL_EXECUTE_END|[186]|Rows:0



 
List<ID> AccountBatch = new List<ID>();
List<Opportunity> AllReceiptableGifts = [select Account.ID FROM Opportunity WHERE (Receipt__c=NULL OR ReceiptQueue__c = 'Replace') AND (Receipt_to__c = 'Contact (Role)' OR Receipt_to__c = 'Account') AND Receiptable_Amount__c>0 AND ReceiptQueue__c = :ReceiptWhen AND CALENDAR_YEAR(CloseDate) = :DonationYear];
 
for (Opportunity d : AllReceiptableGifts)
{
        AccountBatch.add(d.Account.id);
}

accountlimit = integer.valueof(TaxReceiptsNPSP__ReceiptSettings__c.getInstance('Current').TaxReceiptsNPSP__Max_of_accounts_to_receipt_in_batch__c);

List<Account> AccountsinBatch = [SELECT ID FROM Account WHERE ID IN :AccountBatch limit :accountlimit];