Questions tagged [queryexception]
The queryexception tag has no usage guidance.
33
questions
0
votes
2
answers
64
views
Apex Testing Error: System.QueryException: List has no rows for assignment to SObject
I am trying to get my test data set up for an Apex test class I made and I am getting "System.QueryException: List has no rows for assignment to SObject" in the tests error log. Not really ...
0
votes
0
answers
64
views
List has no rows for assignment to SObject error on null check
Salesforce noob here.
I have got an apex trigger that is erroring with "System.QueryException: List has no rows for assignment to SObject" and after researching for quite a bit, I don't ...
1
vote
1
answer
152
views
Allow guest profile to update opportunity line Item
I am trying to setup a web hook to use along side PandaDoc to update opportunity line items once approved but the query on web hook when ran on a guest profile does not return a line item. I can run ...
0
votes
1
answer
60
views
Error:System.QueryException: List has no rows for assignment to SObject
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, UPCustomTrigger: execution of AfterInsert
caused by: System.QueryException: List has no ...
-1
votes
2
answers
136
views
System.QueryException: Implementation restriction: ContentDocumentLink?
I have been following this to create a lightning component for lighting:file upload. As you can see there's comments on how to avoid the System.QueryException yet I still am getting it?
picture of ...
1
vote
3
answers
913
views
Is it possible to cause an exception on a SOQL select statement?
I'm working on writing tests for someone else's code and they have an try/catch around a SELECT statement. Is it possible to ever get an exception in something like the below code block as long as it ...
1
vote
1
answer
508
views
Developer script exception: Do not have access to view running user
I'm trying to debug a "Developer Script Exception".
Apex script unhandled trigger exception by user/organization:
0053000000ARXXX/00D30000000XXX
AccountMasterTrigger: execution of ...
0
votes
1
answer
755
views
How do I check if a list-value from my Map is empty?
I get this error in case if Opportunity__c has no OpportunityInfo__c. I try to check it with the condition if(opportunitiesMap.get(actualTool.Rent__r.Opportunity__c).OpportunityInfo__r != null), but ...
0
votes
1
answer
181
views
How to write Expressions in SOQL Query
I have a custom object Professor
Professor { Name(Text) , Salary(Number) , Bonus(Number)}
I wrote the query in Developer console
select Name from Professor__c where (salary__c + bonus__c) > 7
...
5
votes
0
answers
483
views
System.QueryException: sObject type 'PushTopic' is not supported
As part of our managed package we have a post-install script that inserts push topics to support the integration between our solution and SF.
Before today this post install script worked fine. I was ...
0
votes
1
answer
324
views
Batch Apex System.LimitException: Too many query locator rows: 50000001
There is a object(assume A) which will store event logs for a custom object(assume B). A batch job, runs weekly on object A to delete the records based on some conditions. It throws an exception like ...
0
votes
1
answer
351
views
System.QueryException: Inline query has too many rows for direct assignment, use FOR loop [duplicate]
I have a batch executed : 1 out 4200 is failing with : inline query has too many rows for direct assignment,use FOR loop
My code in the exec function:
List<String> personAccountsIDs = ...
1
vote
1
answer
2k
views
System.QueryException: Implementation restriction: ContentDocumentLink requires a filter by a single... in test class?
I'm facing
System.QueryException: Implementation restriction: ContentDocumentLink requires a filter by a single Id on ContentDocumentId or LinkedEntityId using the equals operator or multiple Id's ...
0
votes
1
answer
793
views
How to test Exceptions (Query and DML) for ContentDocument?
I try to write wrong query, but I get just error un my test, not coverage. If I use try-catch in unit-test - no error and no coverage either. How to test it right? And how can I test here delete DML ...
1
vote
1
answer
3k
views
System.QueryException: sObject type 'OpportunityLineItem' is not supported
We get this script exception (in managed package) emailed from a customer instance.
Apex script unhandled trigger exception by user/organization:
XXXXX/YYYYY
pkg1.ProductOppStockCheck: ...
4
votes
2
answers
2k
views
Non-selective query against large object type (more than 200000 rows)
I have a Set called set_pvCorporativo with about 600 values. I want to bring exactly 600 accounts that have the pv_Corporativo value in set_pvCorporativo AND the Status 'Ativo' in a query like:
List&...
1
vote
1
answer
53
views
Is this a selective SOQL?
Select Id, Field1_Id__c, Field2__c from CustomObject__c where Field1_Id__c =: STRING_CHARACTER_BLANK AND Field2__c IN: setOfIds
Getting the following error when a query as above is executed from a ...
-1
votes
1
answer
204
views
How to insert images/flags on visualforce page to show the outcome of exceptions and invalid field values [closed]
I have a requirement in which I have to show flags/images in VF page in case of any exceptions ... For Eg. If for a field say Receipt__c = true but if the attachments is not added by user for that ...
0
votes
1
answer
364
views
Lead APEX Trigger (Non-selective query against large object type (more than 200000 rows))
I want to write a trigger that creates a 6 digit code and checks if the code is unique.
First of all my trigger:
trigger LeadIdentCodeTrigger on Lead (before insert, before update) {
for(Lead ...
0
votes
1
answer
391
views
custom relationship name salesforce
I want to make a custom relation between Opportunity and Account.
I want to retrieve the account who makes the opportunity
So I wrote this:
"SELECT Id, RecordType.Name, Name, Description, ...
-3
votes
1
answer
442
views
How to run SOQL for an Object having more than 200K records?
I’m trying to populate a custom lookup field called Part Name( API Name: Part_Number__c) on Case Object, where Part Name field is a lookup to Product Object( Maps to Product Name).
We’ve 3 Picklist ...
0
votes
1
answer
911
views
Test for QueryException
I have some code wich I need test and there I have some problem
try {
Contact checkContact = [SELECT Id, FirstName, LastName, Email FROM Contact WHERE Email = :email];
} catch (...
2
votes
1
answer
556
views
Query ApexEmailNotification in APEX
I am trying to query for ApexEmailNotification in APEX, but am not able to.
I am getting this error message
System.QueryException: sObject type 'ApexEmailNotification' is not supported.
The use ...
0
votes
1
answer
161
views
System.QueryException: List has no rows for assignment to SObject for Object created in test case
Can someone help me to understand why I am getting below error message?
It is referring to the lines with DocumentQUoteEmailController and List<contact>.
It seems that I already entered these ...
3
votes
2
answers
820
views
Inconsistency with error "Aggregate query has too many rows for direct assignment"
I have a Box__c record with 100 Doors__r, 104 Motors__r, and 0 Wheels__r.
ISSUE #1
I am getting the error
System.QueryException: Aggregate query has too many rows for direct assignment, use FOR ...
0
votes
1
answer
201
views
Query String with concat from a different method
I'm trying to query to run a Batch but the problem is that Im getting errors with the query string
public with sharing class ApiLogsPurgeJob implements Database.Batchable<sObject>, Database....
0
votes
1
answer
322
views
System.QueryException: Non-selective query against large object type (more than 200000 rows)
I have created an app that would change CampaignMemeber Status Values by calling our web application api and storing info in custom objects. In my developer org where the package is created works fine ...
1
vote
2
answers
719
views
Non-selective query against large object type error even on an indexed field
I have the dreaded Non-Selective query error but I am not sure why. I am on the Lead object and querying against 3 fields which are indexed so I am not sure why I am getting this error. I do have over ...
5
votes
2
answers
9k
views
Inline query has too many rows for direct assignment, use FOR loop
I am receiving an error stated above on line 26**(listAccount1)**, can anyone guide me on how to solve it?
public class FRB_UpdateExceptionsforBatch
{
public static void FRB_Exceptions(){
...
1
vote
2
answers
10k
views
SOQL query is not working in Test class coverage
I wrote three soql queries in test class
static testMethod void test_DoGet() {
RestRequest req = new RestRequest();
RestResponse res = new RestResponse();
...
0
votes
1
answer
503
views
List has no rows for assignment to SObject Customer Portal - Communities
I need your help to understand what's happening here.
We are using the Customer Portal (Community) for quite a long time, we use 'Customer Community Login User' profiles that we assign to external ...
-2
votes
1
answer
54
views
Test class code coverage?
I got this error when trying to execute apex test class.
System.QueryException: List has no rows for assignment to SObject line
no:60&line no:82
This my code
@isTest
private class ...
0
votes
1
answer
99
views
Contact Record - System.QueryException: List has no rows for assignment to SObject
Task a=new Task();
a.whatid=Acc.id;
a.Status='Communication Sent';
a.Action__c='Auto Execute';
a.Adhoc_Communication__c=True;
a.Email_Address__c='henry@gamil.com';
a.Encrypted_Reference_Number__c=
...