Questions tagged [exception]

An exception denotes an error that disrupts the normal flow of code execution.

Filter by
Sorted by
Tagged with
0 votes
1 answer
28 views

Attempt to de-reference a null object when throwing a custom exception

I have created a custom Exception class public class StatusException extends Exception{}; when using it to throw an error it's throwing a null pointer exception too. public class ContainerSync2 { ...
user avatar
0 votes
0 answers
51 views

UNABLE_TO_LOCK_ROW too soon

According to Salesforce's documentation a transaction can wait for up to 10 seconds before throwing an exception with the code "UNABLE_TO_LOCK_ROW". Yet I get the following scenario: ...
user avatar
  • 1
0 votes
0 answers
23 views

Email deliverability is off but still receiving Apex Exception emails - is this expected?

The Email Deliverability setting is off. As per the doc, all outbound emails to and from users are stopped. What I'm perplexed about is that I am still receiving some Apex Unhandled Exception emails. ...
user avatar
0 votes
0 answers
58 views

ServiceSDK ServiceCore crashes during iOS 15 prewarm

At our company we're using the embedded ServiceSDK (version 234.1.0) for iOS https://developer.salesforce.com/docs/atlas.en-us.service_sdk_ios.meta/service_sdk_ios/servicesdk_ios_dev_guide.htm After ...
user avatar
  • 1
-1 votes
1 answer
28 views

I am unable to insert 10000 records. Getting Too man query rows error

public class CreateBulkAccounts { @future Public static void method1() { List<Account> acList = new List<Account>(); for(integer i=0; i<10000; i++) ...
user avatar
0 votes
1 answer
85 views

Invalid date/time issue in Apex Code

I am working on a REST API integration class and it is passing a field called effectiveDate as part of the response. However, the data in the field is not consistent. Sometimes, it is passing the ...
user avatar
-1 votes
1 answer
32 views

try catch block not catching limit exception after query

I have a SOQL query call inside a try catch block, because I want to catch if a LimitException is thrown, but for some reason, when the exception is thrown after the query,the aura handled exception ...
user avatar
1 vote
1 answer
39 views

Trigger After update doesn't show custom exception message

I created a trigger that throws an exception when the Order do not have the required attachment types. I would like the message 'Required document types were not found' to be displayed to the user. ...
user avatar
  • 79
0 votes
0 answers
108 views

secure query included inaccessible field

I have a test method which I am trying to run from a particular profile. I am trying to access an object called Interaction and that profile has real all record permission. When I am running the first ...
user avatar
  • 507
4 votes
1 answer
126 views

What can be achieved with Finalizers that was not achievable before?

I have gone through the documentation and read the examples and use cases. However, I am still struggling to understand how Finalizer add value and what can we achieve with it that was not achievable ...
user avatar
0 votes
1 answer
47 views

Collection size 1.079 exceeds maximum size of 1.000

I create a very simple query to display the result at visualforce and render as pdf to store the pdf in an account. Unfortunately I ran always into Collection size 1.079 exceeds maximum size of 1.000 ...
user avatar
  • 95
0 votes
0 answers
20 views

Received exception event aura:systemError from server when sending a list from LWC to apex

I have created an LWC that reads a CSV file using <lightning-input type="file" label="Upload CSV"></lightning-input> This converts the CSV file into a list of objects ...
user avatar
  • 155
0 votes
0 answers
49 views

Community User creation Error Nickname already exists

I have been trying to create a community user via apex and even though the user is getting created in salesforce, I am getting the exception as "That nickname already exist. Enter a unique ...
user avatar
1 vote
1 answer
89 views

Health cloud exception : System.TypeException: duplicate field selected: HealthCloudGA__Gender__c

17:03:45.999 (4002819908)|EXCEPTION_THROWN|[435]|System.DmlException: Update failed. First exception on row 0 with id 00Q3N000004BCH1UAO; first error: CANNOT_EXECUTE_FLOW_TRIGGER, We can't save this ...
user avatar
1 vote
1 answer
130 views

Batch Apex Uncatchable/uncaught exceptions

I had understanding that if batch apex execute method encounters an uncatchable/uncaught exception, then it stops the batch processing at that particular execution of execute method and does not ...
user avatar
  • 304
0 votes
2 answers
177 views

Handling FIELD_INTEGRITY_EXCEPTION with try catch and logging errors

I have got an apex trigger that sometimes errors with System.DmlException: Update failed. First exception on row 0 with id 00Q0800000fhnM2EAI; first error: FIELD_INTEGRITY_EXCEPTION The reasons for ...
user avatar
  • 103
0 votes
1 answer
36 views

How to handle validations from trigger to show as exception or toast on managed package layout

I currently have a custom pagelayout from a managed package. In this pagelayout a list of records can be selected to create new records for another object. I have a before apex trigger in which I want ...
user avatar
  • 2,090
1 vote
0 answers
349 views

LWC Flow Control - Finish throws exception

THE CONTEXT: I am creating an LWC as a screen flow element. The LWC is very simple, it displays in a radio button group all of the existing Opportunity record types. Once the user selects a record ...
user avatar
-1 votes
2 answers
217 views

DML in a future method will be rollback if after there's a throw exception

My classA calls classB which calls a future method inserting an object, later in classA it throws an exception, and I saw my DML in future method is also being rollbacked. Is there anyway to commit ...
user avatar
  • 33
0 votes
0 answers
17 views

I have this custom controller for a vf page please help me to write the test class..actually I have written but not covering else and catch [duplicate]

@isTest public class LoanPaymentPdfControllerTest { @TestSetup static void testSet(){ // create Account Account accnt = PFSTestHelper.getAccount(); insert accnt; ...
user avatar
0 votes
2 answers
175 views

Semi join sub-selects are only allowed at the top level WHERE expressions and not in nested WHERE expressions

I am currently facing an issue while trying to update the criteria of a SOQL query and was wondering if anyone could help me out. To provide some context: I am building an automation to propagate ...
user avatar
0 votes
1 answer
103 views

Exception during test execution: ConnectApi.ConnectApiException: INVALID_API_INPUT - Order is not Activated

This is how we are activating the order in the test class // update order status to activated List<Order> lstOrderToUpdate = new List<Order>([SELECT Id,status,AccountId FROM Order WHERE Id ...
user avatar
  • 1
1 vote
1 answer
584 views

throwing aurahandledexception is not sending message correctly to LWC

I am calling an apex controller, that has several try-catch blocks that throw exceptions depending on the error or situation, (i am also throwing outside of try catch blocks) this is an example: try{ ...
user avatar
0 votes
0 answers
30 views

Can't generate a CSV from a Report record

I've written an invokable APEX method that: (a) generates a csv from a report record (b) sends an email to an address with the csv file as an attachment (c) marks some subscription records as exported ...
user avatar
0 votes
1 answer
42 views

Handling Exceptions From Different Parts of the Code

I've got a case where different parts of the code need to handle exceptions differently, and was wondering if there is a pattern or a recommendation for approaching the problem. Let me explain exactly ...
user avatar
0 votes
0 answers
45 views

Generating a CSV through a report inside an invocable method THROWS exception, but in a normal method it doesn't!

I am trying to generate a CSV through an InvocableMethod but it throws an exception. If the same code runs in a normal method, then no exception is thrown. In the following code for example sendEmail2 ...
user avatar
0 votes
2 answers
117 views

Null pointer exception inside for Loop

Here is the code: for(Requests curRequest : requestList){ if (curRequest.varSRProduct!= null ){ for(SObject so : curRequest.varSRProduct){ //code } } ...
user avatar
0 votes
1 answer
342 views

Apex classs exposed as Rest API giving 404 error on call

I am trying to test my Apex class code exposed as rest api. For this, I am making a call to this API using postman. Below is the class I created @RestResource(urlMapping='/SurboChat/SaveChatTranscript'...
user avatar
  • 1
1 vote
1 answer
74 views

List has no rows for assignment exception on AuraEnabled method

I have created an Apex Class with an AuraEnabled method, which I am calling from a Lightning component. After the method is called I am receiving the below error. There was an exception List has no ...
user avatar
0 votes
3 answers
2k views

Type cannot be constructed: Exception

In Apex I have this: ... if (forceException) { Integer a = 1/0; } ... But after I ran SFDX Scanner I got an error that variable a is defined but not used (UnusedLocalVariable) so I decided to do ...
user avatar
  • 99
0 votes
0 answers
237 views

error: Illegal assignment from Object to Map<String,String> [duplicate]

String input = '{"orgId":{"isRequired":"true", "valiateDataType": "Id"},"numOfVehicles":{"isRequired": "true"}}'; Map<...
user avatar
1 vote
0 answers
300 views

Change data capture event not firing associated trigger in production

I have a custom trigger that fires on an OpportunityChangeEvent: trigger EXAMPLE_CREATE on OpportunityChangeEvent(after insert) { // Get the change event’s product ID for added and updated products ...
user avatar
1 vote
1 answer
235 views

multiple addError() behaviour in apex

We have a trigger on the Account and Contact objects. The job of these triggers is to prevent the deletion of Account and Contact objects depending on the criteria. Account should be deleted if no ...
user avatar
  • 1,313
2 votes
1 answer
99 views

Method not getting called after addError, Please advise

I am new to SFDC please help. Requirement: Restrict user deactivation if Account is owned by the user and send an Email with details. Trigger on user object: trigger userTrigger on User (before ...
user avatar
1 vote
1 answer
257 views

JS Promise.all and a combination of failed and successful Apex calls: how to deal with that?

In the controller of a LWC, we use Promise.all to call an Apex method with different inputs. The code for this: const funcs = productCodesBatches.map(productCodesBatch => getSearchResultsBatch( { ...
user avatar
0 votes
2 answers
227 views

CPU Timeout Error for 9k records after resolving Too many DML rows: 10001

What do I have? Two objects ObjectA and ObjectB without any trigger/process builder/flow. I create a trigger on ObjectA to create the same number of records on ObjectB What is my test case? Insert ...
user avatar
0 votes
1 answer
89 views

Facing Mixed DML operation for apex class

I have written a scheduler for deactivating salesforce users who doesn't logged in for last 90 days. The code is working as expected if I remove exception logging into a salesforce object at line #14. ...
user avatar
  • 397
0 votes
1 answer
294 views

Logging Apex exceptions through Event Bus while still rolling back the entire transaction?

I'm working on implementing a robust error logging framework for our org using Platform Events to ensure that we always capture errors in our code even if the transaction is rolled back. If I use ...
user avatar
-2 votes
2 answers
1k views

Apex error : You have uncommitted work pending. Please commit or rollback before calling out [duplicate]

Apex error : You have uncommitted work pending. Please commit or rollback before calling out. I get the above error when I try to make two http callout one after the other and store the result in ...
user avatar
  • 11
0 votes
1 answer
45 views

AuraHandledException message: extra word ("Exception") at beginning of message

I am working on a component+Apex class. I need to throw an error message via AuraHandledException. Everything seems to be working fine except for the error message itself: it's showing up with an ...
user avatar
1 vote
1 answer
362 views

Apex safe navigation operator chaining

I'm a little bit confused. Let's say we have a code String[] recordTypes = AppConfigData__c.getValues('dummy')?.value__c.split('\\s*;\\s*'); Why it works even if getValues() returns null? Why split ...
user avatar
  • 687
1 vote
0 answers
175 views

getContent() throws ApexPagesGenericException 404

When trying to retrieve a json file from a zip file, I get the following error: Error: System.VisualforceException: core.apexpages.exceptions.ApexPagesGenericException: 404 status code return from ...
user avatar
  • 1,443
3 votes
1 answer
149 views

Latest on reviewing errors in a managed package

I know this has been discussed before but all of the threads are several years old. I couldn't find a finite answer and also I am trying to find out if anything has changed since. I am trying to ...
user avatar
  • 4,441
1 vote
0 answers
189 views

Updating Opportunity Splits in Apex field integrity exception

I'm trying to automate Opportunity Splits and I'm running into the following when trying to upsert them for a given split type: System.DmlException: Upsert failed. First exception on row 0 with id ...
user avatar
  • 1,057
0 votes
1 answer
310 views

Prevent a rollback of an inserted record due to an exception [duplicate]

I have a LWC component which calls an apex class that does callout: public static List<Case> doCallout(List<Case> cases) { ....... CalloutLogger.insertLog(req, res, time); ........
user avatar
  • 456
0 votes
1 answer
152 views

LWC - Exception when calling child function more than once

I'm having an issue while developing an LWC and was hoping someone could help as the error isn't super clear to me. I have LWC A which contains LWC B (check example code below): <div ...
user avatar
0 votes
1 answer
216 views

Throw an exception in Apex if attachment is null

I have a Visualforce form that takes attachments of which I need to make required in order for the user to proceed to the next screen. Since the record doesn't get inserted until the end of the multi-...
user avatar
0 votes
1 answer
95 views

How to get the inner exception?

So I catch a DMLException which is caused by a custom exception from a managed package, now how can I get that custom exception? Here is the log: 18:33:24.391 EXECUTION_STARTED ... 18:33:25.710 ...
user avatar
3 votes
3 answers
1k views

try catch finally and inserting records

We have an error log object where we store the errors and I have a simple try catch like below... My issue is that the insert in the finally does not appear to be happening. Any advice? or is that a ...
user avatar
  • 372
0 votes
0 answers
520 views

Why aren't I receiving flow error emails in my sandbox?

I have a Process Builder that is failing to complete when a record is created, when I attempt to create the record a failure message is returned "We cant save this record because PB-NAME has ...
user avatar

1
2 3 4 5
11