Questions tagged [exception]

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

Filter by
Sorted by
Tagged with
-1 votes
1 answer
31 views

Validation Rule Conflicting with Process builder

I have this validation rule which locks the field of opportunity when its closedwon/lost. But it is not working as it is conflicting with a flows(which updates closewon/lost dates as today() ) saying ...
Rajdeep Baghel's user avatar
3 votes
0 answers
67 views

Platform Events - setResumeCheckpoint method is not working as expected after throwing an EventBus.RetryableException

We have a Platform events framework that takes the responsibility of processing a batch of n incoming platform events. This framework was working fine until around one/two months ago when we realized ...
Alvhix's user avatar
  • 71
0 votes
1 answer
28 views

'uncommitted work pending' even when all DML statements have been deactivated

Our system is pretty complex with DML statements, call-outs and future methods everywhere. After adding some more functionality, I ran into the dreaded 'uncommitted work pending' error. It had been a ...
Sander de Jong's user avatar
0 votes
0 answers
60 views

Trying to find objects that are capturing the row lock, bulk data load jobs, failed flows, etc

I'm trying to monitor the below issues. Could someone please help us to get insights on which object the below information gets captured. Row lock errors/issues Bulk Data load Jos errors/issues Audit ...
Bforce's user avatar
  • 6,806
0 votes
1 answer
93 views

Apex is throwing error but LWC is not catching and displaying the correct Toast message

I have created a validation rule on Order Product Object, it is working as expected on the record page. While making changes from LWC, error message is not shown, instead a success message is showing ...
Shashwat Chaturvedi's user avatar
-1 votes
1 answer
44 views

Can AuraHandledExceptions appear on an Aura component without being processed by an action callback function?

I have a custom error page that should appear every time an error appears from the middle/back end. I have an Aura component that is using this. This Aura component has 4 actions that call its Apex ...
seekingPeace's user avatar
-2 votes
1 answer
63 views

Exceptions on Client side Aura,LWC [closed]

What are types of exceptions on client side in Aura, Lightning Web Components?
Prathyusha's user avatar
0 votes
2 answers
147 views

Is DmlException is enough to catch all exceptions once wrapped for DML operation?

If we are using try catch only on DML operation part, where on catch block if only DmlException is used, then would it be enough to handle all possible errors occurs there or we also need to use ...
ItsVicky's user avatar
1 vote
0 answers
117 views

How to handle DML exceptions in apex class WITH USER_MODE?

I'm trying to do a DML with user mode in apiVersion 58.0. I got "DML Exception" while inserting records without field permission and I got "SecurityException" while inserting ...
Senthil Kumar's user avatar
0 votes
1 answer
102 views

Throw Exception still remains 'SUCCESS' state in aura component

My aura component still retrieve a response with 'SUCCESS' state even though I threw Exception. My aura component's controller handleApproval: { var recordId = cmp.get("v.recordId"); var ...
Tuấn Trần quốc's user avatar
0 votes
0 answers
119 views

How to create reusable LWC to handle exceptions in JS?

I have created a reusable LWC JS file lwcExceptionLogging.js const lwcException = (err) => { console.log(err.name+'--Name'); var name = err.name; console.log('log Name--'+name); } export {...
Prathyusha's user avatar
1 vote
1 answer
1k views

Problem getting consistent error stack trace in LWC

I am trying to capture an error thrown from Apex in my LWC promise chain, with an end goal to publish a Slack message with the error details. The slack message template contains the following needed ...
Lucas Santanna's user avatar
0 votes
1 answer
92 views

Custom exception maximum message length?

What is the maximum length of the message of a custom exception? class CustomException extends Exception{} public static void throwException(){ String message = 'lots of text........'; if(...
fred's user avatar
  • 2,773
0 votes
1 answer
108 views

How to insert related record when DUPLICATES_DETECTED error is thrown from Salesforce Matching Rule?

I have a requirement to insert CampaignMembers whenever a duplicate Lead is identified. The duplicate check for all Leads of all Lead sources is handled via Standard Duplicate rule. This rule needs to ...
Apex Srinivas's user avatar
0 votes
1 answer
32 views

I want to show error msg, If user has no access for CustomPermission named "deleteFileAccess"

The method is @AuraEnabled public static void deleteSelectedFiles(List<String> contentDocumentIds) { try { if (!contentDocumentIds.isEmpty() && contentDocumentIds != null) { ...
Santosh P's user avatar
3 votes
1 answer
192 views

Trigger.isBefore throwing a NPE in if statement

I ran the following code in anonymous apex: System.debug('Value of Trigger.isBefore: ' + Trigger.isBefore); if (Trigger.isBefore) { System.debug('In is before trigger.'); } Line 1 prints: "...
Arthlete's user avatar
  • 4,855
0 votes
0 answers
192 views

I am getting this INSUFFICIENT_ACCESS_OR_READONLY:insufficient access rights on object id:-- for all Campaign Member records

INSUFFICIENT_ACCESS_OR_READONLY:insufficient access rights on object id:-- User profile is System Administrator Marketing User is also checked. Where can I provide access?
Chitvan Mishra's user avatar
0 votes
0 answers
50 views

How to turn all triggers off in salesforce for a particular user?

I have a usecase where for a particular users I want to turn all triggers off. Is there a way to do it from Salesforce lightning UI or java code programatically? I can't modify the triggers themselves....
Chitvan Mishra's user avatar
-1 votes
2 answers
135 views

Bulk update of custom field value in salesforce object failing due to custom validations and triggers

I added a custom field to opportunity salesforce object. It's name is externalId__c. The field is added to the object. However when I am trying to update the value of externalId__c for all the records,...
Chitvan Mishra's user avatar
0 votes
0 answers
33 views

GACK Response Closing a Case and get an Unknown Exception Code

We are trying to close a case that was reopened and then when we go to close it again, we get the following error message. We recently went through the Spring Update 2023 and wondering if there is a ...
jeffrose2utah's user avatar
-1 votes
1 answer
223 views

Help with "FIELD_CUSTOM_VALIDATION_EXCEPTION" Batch class failed to update records

I have a similar batch class and the problem is not with the logic. public class SimpleBatch implements Database.Batchable{ public Database.QueryLocator start(Database.BatchableContext BC){ return ...
sangeetha balasubramanian's user avatar
0 votes
1 answer
178 views

How to write testclass for custom exception

How do you write test class if the exception has been thrown public class UserService{ public class UserServiceException extends Exception{} public static Contact createUser(...
Shugi Yen's user avatar
1 vote
1 answer
210 views

Internal Salesforce.com Error on CUMULATIVE_LIMIT_USAGE or LIMIT_USAGE_FOR_NS

Issue: I'm experiencing a Fatal Error - Internal Salesforce.com Error while running a query that could be possibly be returning a huge number or records. Any thoughts on how to resolve this? ...
Cephas's user avatar
  • 11
1 vote
2 answers
238 views

How to address null-pointer exception

I Have the following apex code which is throwing a nullpointer exception on the line: points = points + value; List<JMG_ExternalSearch__c> searchList = [SELECT Id,LastModifiedDate,...
Thomas's user avatar
  • 2,294
0 votes
1 answer
112 views

Fetching information like login time, checking from Sales cloud in Marketing cloud using SSJS

I was able to use the below code in one environment and I am getting the expected results. When I am trying to run the same (I did modify necessary things like change in DE external key, network ID ...
Roma's user avatar
  • 1
0 votes
0 answers
72 views

Catching exception in QuickActionDefaultsHandler

I am using the QuickActionDefaultsHandler method in an Apex Class to set some default fields when sending an email. Since it's an apex class, it is possible for it to error out and throw an exception....
hamayoun's user avatar
  • 2,727
0 votes
0 answers
305 views

How to catch exception for "Can only throw this exception type from VisualForce or Aura context"

I have an apex class that does not interact with Aura. Sometimes I get the error "Can only throw this exception type from VisualForce or Aura context". I'm looking to see if I can catch that ...
DigitalWoman's user avatar
-2 votes
1 answer
117 views

Show exception message in lightning without stacktrace APEX?

I want to show a duplicateRule message Error without showing stacktrace and the line of my code where the error is. I tried with this : public class applicationException extends Exception {} ...
Abbes CHOUKCHOU's user avatar
1 vote
0 answers
119 views

Two Post Install Exceptions occurred while installing Health Cloud

We are installing Health Cloud into a new, clean org. The pre-installation steps were carried out prior to the installation, ie Chatter enabled, Contact to multiple Accounts, etc. After the ...
Andrew's user avatar
  • 11
0 votes
1 answer
230 views

Prevent DML rollback when custom exception is thrown

In our org we are calling batches from an external system using salesforce API. When a batch is failing the external system create a bug and it goes into our standard processes. A new requirement has ...
Julien Souchi's user avatar
1 vote
1 answer
572 views

Throw exception, Insert Log error and send mail in same time in APEX

in apex, can it be handled so that when the program runs an error and the catch fires an exception, can this exception do 3 things at the same time? (I used platform events and it only gives 1 and 2 ...
David's user avatar
  • 13
-1 votes
1 answer
85 views

How to get CPU consumed by each Apex [closed]

I am trying to find some way to build an application/report which shows CPU time consumed by each class per execute. Please refer below table to get more details of the ask. APEX Class Consumed CPU ...
Mehul's user avatar
  • 1
1 vote
0 answers
196 views

"ExecutionException: List index out of bounds: 0" while sending email from Apex using email template with Custom Object merged fields

Here is the code- public static void sendEmailToUser(String email, String emailTemplateNameText, String selectedRecordId){ String emailTemplateName = '%' + emailTemplateNameText + '%'; ...
Prapti's user avatar
  • 45
-1 votes
1 answer
4k views

Getting FIELD_INTEGRITY_EXCEPTION:field integrity exception: TotalPrice (total price must be specified):TotalPrice

I'm getting following exception while updating a custom field on Opportunity Product. FIELD_INTEGRITY_EXCEPTION:field integrity exception: TotalPrice (total price must be specified):TotalPrice Details:...
Rose 's user avatar
  • 111
3 votes
1 answer
391 views

Why does this assertion fail when comparing exceptions?

I have a test method that asserts an expected exception equals the thrown exception but it fails, but the error message says they are the same @IsTest private static void isThrowable() { // given ...
TemporaryFix's user avatar
  • 2,897
0 votes
1 answer
230 views

should exception's inner class be public or private

Scenario: I have 1 APEX class, in which I have inner class extending exception, as can be seen below: public with sharing class ClassA{ PUBLIC/PRIVATE class ClassBException extends ClassCException {...
user43598's user avatar
  • 447
0 votes
1 answer
1k views

Call method in another class

I have UtilityController class for creating new records of custom object: Exception_Logs__c. How to call this class inside another class? So if error occured, then the Exception Log will be created. I ...
ApexNewbie's user avatar
0 votes
0 answers
314 views

Exception "Exception occurred in direct soap call" while trying to save changes in an Einstein Bot

I get the following exception with Bots: "ui.services.connection.api.ToolingConnectionException: com.sforce.ws.ConnectionException: Exception occurred in direct soap call". It happens in the ...
Aylen's user avatar
  • 11
0 votes
2 answers
449 views

On updating, it shows System.ListException: Duplicate id in list: 0015j00000eFggSAAS

I am having this exception on after update trigger on updating any MailingState field of contact object. I want to update the value of Contact's 'MailingState' field to the Account's 'BillingState' ...
Devesh's user avatar
  • 1
0 votes
1 answer
115 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 { ...
Mridul Kapil's user avatar
1 vote
0 answers
202 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: ...
alozzi's user avatar
  • 11
0 votes
0 answers
164 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. ...
Andy Hitchings's user avatar
-1 votes
1 answer
339 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++) ...
narojoc807's user avatar
0 votes
1 answer
2k 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 ...
Balaji Pooruli's user avatar
-1 votes
1 answer
738 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 ...
joacoiudica's user avatar
1 vote
1 answer
344 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. ...
Cline's user avatar
  • 111
0 votes
0 answers
5k 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 ...
Ishan's user avatar
  • 537
4 votes
1 answer
419 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 ...
Gabriel Serrano Salas's user avatar
0 votes
1 answer
131 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 ...
Rag21's user avatar
  • 105
1 vote
1 answer
347 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 ...
sunil Bhoslae's user avatar

1
2 3 4 5
12