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

learn more… | top users | synonyms

2
votes
2answers
48 views

Assertion failure that a null pointer exception is caught

I am doing some test code right now. In my Apex code I have a method that try-catches a DMLException and afterwards does a general Exception catch. In my test code I am successfully managing to test ...
0
votes
1answer
14 views

Apex Exception Handling sending Email

I am trying to send an email whenever an exception occurs. The issue I think is the catch part is not firing. as the email are going when written outside catch part/ public class WebServiceCallout { ...
-2
votes
1answer
38 views

System.LimitException: Apex CPU time limit exceeded [closed]

getting exception Apex CPU time limit exceeded at line no 118 public class TStringUtils{ public class Bitset{ public Map<String,Integer> AlphaNumCharCodes {get;set;} public ...
4
votes
1answer
30 views

Internal Salesforce Error (GACK) Deleting Account w/ restrictedDelete ContentVersion

I recently 'succeeded' in getting an Internal Salesforce Error aka GACK. Per Josh Kaplan's blog page, I am posting the details and cause in case someone else runs into this before SFDC fixes it. And ...
3
votes
3answers
91 views

Revert/rollback record states on error

Consider the following block of code that is called on save of a basic data entry page: public PageReference save() { // accounts is binded to VF page for (Account a : accounts) { ...
1
vote
2answers
40 views

batch class Run fine with individual record but not working fine with multiple records

I am writing batch class to deactivate users if no dependency and freeze user if any dependency.When i hardcode singal value of userid and run batch it works fine it deactivates user.It is not going ...
1
vote
2answers
69 views

Page message Problem?

I have four scenarios with catch exceptions in controller and used "apex:pageMessages" only once in Visualforce page.But that is not working for all the scenarios? Is it mandatory to use ...
0
votes
3answers
31 views

Not able to catch exception using try catch block

I am using try-catch block to catch exceptions.code is executing inside try block.Exceptions happens which i am thinking i am handling in catch block.When i debug whole code after exception code is ...
1
vote
2answers
48 views

SendEmail error: You have uncommitted work pending

My code works everywhere except in a particular client sandbox. It basically sends an email on insert of a record. Pseudo-code in PKG A trigger on after-insert of recordX ...
-2
votes
0answers
46 views

Getting error on database.update().Not able to add ids of exception users to a set

The error is at line List<Database.SaveResult> results= Database.update(listUserDeactivate,false) (look for /* ### Error on Below Line ### */); I want to catch those users for which exceptions I ...
1
vote
1answer
11 views

Visualforce-Community: Is it possibe to override the errorpages AND get there a full Exception display including StackTrace?

Working on Communities, but getting only the generic Errorpages is not useful for managing bug-reports. By default it looks like this: I know how to override that here: I would like to see as ...
1
vote
0answers
16 views

On saving page error : List controllers are not supported for OrderItem [duplicate]

I am trying to do edit for selected OrderItems using StandardSetController, however, when I am saving page, I am getting following error. List controllers are not supported for OrderItem. ...
0
votes
1answer
25 views

Change Salesforce Error Messages?

Currently when Apex code on a VisualForce page throws an exception the user is shown what line of code threw the exception and some other information. I want to change this to show a custom error ...
0
votes
2answers
29 views

Facing System.NullPointerException: Attempt to de-reference a null object issue

There is an issue with the test class: Error Message System.NullPointerException: Attempt to de-reference a null object Stack Trace Class.AnalyzeObjectBatch.start: line 30, column 1 global ...
1
vote
2answers
28 views

How to unit test exception handling when the source of an exception is external to the code being tested

Let's say we have some class MyClass: public class MyClass { public void doSomething { // do some stuff try { OtherClass.staticMethod(); } catch ...
0
votes
1answer
21 views

Attempt to dereference a null object

I am running tests on the following code: global class CarrierTrackingBatch implements Database.Batchable<sObject>, Database.AllowsCallouts{ global String ShippingStatus; global String query; ...
5
votes
3answers
135 views

Customer Community Plus User Cannot Add Other User

Within my community there are customer users with Customer Community Plus licenses who are considered to be "company admins" for their respective companies. A company admin needs to be able to add ...
1
vote
1answer
35 views

Getting System.CalloutException: You have uncommitted work pending. Please commit or rollback exception even after @future call

I have done following things and i don't think i should get his Exception - 1) Logger.debug(LoggingLevel.INFO, 'Custom Message'); - A custom logger class 2) after above logger a call out to other ...
1
vote
1answer
45 views

Batch Job Error: Too Many queries: 50001

public class UpdateBrandBatch implements Database.Batchable<sObject>, Database.Stateful { final List<SObject> records = new List<sObject>(); final string query1, query2; ...
1
vote
1answer
33 views

Getting System.CalloutException: You have uncommitted work pending [closed]

I am getting an exception of System.CalloutException: You have uncommitted work pending. Detail of the Exception is given Below: Exception: :System.CalloutException: You have uncommitted work ...
3
votes
1answer
33 views

How to over write salesforce standard exception message in catch block?

I am using catch (Exception e){ ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.FATAL,'my error msg'); ApexPages.addMessage(myMsg); } And have ...
0
votes
1answer
46 views

System.NullPointerException: Attempt to de-reference a null object apex test classes

The Below code is a test class where I get my null pointer exception app Builder: public with sharing class appmaker extends packmaker { public override String buildpack(Object[] records) { ...
0
votes
2answers
37 views

How to handle error thrown by Validation rule when a trigger fires?

I have a trigger on "Opportunity" object which on record update also updates it "OpportunityLineItem" records. We have a validation rule on "OpportunityLineItem" that if a field is blank the error ...
0
votes
2answers
64 views

Need help in overcoming this exception

I am running into this exception when running my test class: System.DmlException: Insert failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, portal users cannot own partner accounts ...
0
votes
1answer
23 views

Multiple email attachment failure

I have below code to send multiple email attachments in a single email which is throwing below error. Can some one please tell me what's wrong here? Code Snippet Messaging.EmailFileAttachment efa = ...
0
votes
1answer
19 views

Why do I get a DisjunctionsNotSupportedException when doing a SOQL query on Custom Metadata?

I'm performing this query against a Custom Metadata object: SELECT Call_Center_Display_Script__c FROM VDN_Mapping__mdt WHERE VDN__c = '99999' OR DNIS__c = '123456786' LIMIT 1 But I'm getting this ...
4
votes
1answer
69 views

Queueable Apex: Unable to log exception to a custom error object

I am developing a Queueable class in Apex. This class is going to be used to feed data to salesforce from external systems. I am seeing the following issue. I followed this example of logging to a ...
6
votes
1answer
72 views

NinjaValidationException

I encountered the following exception when trying to insert a CollaborationGroup in a test: System.DmlException: Insert failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, ...
1
vote
1answer
32 views

Get the row number where Exception occured

I got a VF page where a user can enter many contacts and save them all in one go. I got a validation on Email field to stop the user entering duplicate values when saving records. Therefore to catch ...
0
votes
1answer
315 views

system.security.NoAccessException: Update access denied for RecordType

I have a Visualforce Page that uses a standard controller (Opportunity) and an extension. In the extension I have a method that saves updates to the opportunity and a related contact. The extension is ...
0
votes
0answers
10 views

triggers clash on caseobject and contact object

I have two triggers on two objects on Case JoinContactToCase on Case (before insert, before update) and second contact object updatephones on Contact (after insert) { I have written test class for ...
1
vote
2answers
30 views

Strange error on product clone

Anybody seen errors like this before? Any fixes? I'm expecting this to be something deep down in the Salesforce platform and not something I've done but any guidance appreciated. (I notice Sneezy ...
0
votes
1answer
38 views

Test class for Error Handler class

I have a class for the purpose of handling error. I want to write a test class for the same. Can somebody please help me as I am new to salesforce. Below is my code of the class. public class ...
0
votes
1answer
35 views

Handling Duplicate Id in List Exception

I have junction object ProjectxOpp__c which links Projects (MPM4_BASE__Milestone1_Project__c) with Opportunities. It's a many to many relationship so the same Opportunity can be linked to multiple ...
2
votes
1answer
84 views

Cloning records from 1 object to another object

I have 2 different objects objA and objB with same object model(all the fields api name and no of fields are same). Now when a change happens I want to clone the same records from objA to objB. It is ...
2
votes
1answer
118 views

Apex strange exception handling

I have a problem with my trigger. In Sandbox, everything works fine. When I deploy it to production, I receive multiple exceptions - which is really strange, because I got angry and put the whole code ...
0
votes
3answers
66 views

How to avoid a QueryException with null SOQL queries?

I've been exploring different ways to assign a SOQL query that would potentially have no results in some situations (when working correctly). However, I can't seem to avoid the ...
1
vote
1answer
83 views

System.TypeException - Procedure is only valid for System.DmlException and System.MailException

I have a Class exposed as service and is consuming the xml for Oppty with an external ID. Based on the extID, update operation is being done. Update operation is followed by exception handling. From ...
1
vote
1answer
28 views

How does salesforce notify the solution provider in the error message “Your Solution Provider has been notified”?

We are an ISV partner and sometimes our clients get the following error when working with our package. We want to know where the notification goes and how we are notified so we can catch the bug ...
2
votes
1answer
26 views

Custom message on Add/Remove members

I have implemented an apex method that prevents a certain profile (let's call it A profile) from being removed from a Collaboration Group. The apex code works fine but I don't know if there's a way to ...
1
vote
1answer
20 views

Issue of type casting

I have below statement throwing String Exception. selRepId = ApexPages.currentPage().getParameters().get('RepId'); Here selRepId is a Public getter setter set ID field. Is the issue like string to ...
1
vote
3answers
84 views

Null pointer exception during initialization of an object

List<Products2> product = [select....]; if (product != null) { Quote_Line_Item__c qli = new Quote_Line_Item__c(); } I am getting a null pointer exception inside IF condition. ...
2
votes
1answer
153 views

System.sObjectException: Invalid Field – trying to use a nested SOQL query

I am getting a System.sObjectException: Invalid field error when trying to assign a value across objects. Also, I'm trying calling my method via Process Builder using the @InvocableMethod annotation ...
1
vote
1answer
80 views

RemoteAction's Exception message

Currently, Whenever an exception is encountered in RemoteAction, the response looks like something below [{ "statusCode":200, "type":"rpc", "tid":5, "ref":false, "action":"vchav1.DeepViewController", ...
0
votes
0answers
12 views

How to avert the error of “Too many token validations for user” in Product org?

When I`m making development on a Product Org for a while, the eclipse often return an error message as following: System.SecurityException: Too many token validations for user I`d like to know that ...
1
vote
0answers
61 views

Difference between Exception and DMLException

I am inserting an object in Apex which has two master-detail relationships to other objects but as far as I can tell, the permissions on these objects are set fine. When I try to insert my records ...
3
votes
1answer
40 views

Run-time Exception Handling

I am trying to define a generic error handling for my apex application. I have my try/catch blocks in controllers/extensions at various methods. I am able to check and catch business logic related ...
2
votes
1answer
60 views

Tooling API query unknown exception

While these queries work: select Name from StandardAction where EntityDefinition.QualifiedApiName = 'Account' select Name from StandardAction where EntityDefinition.QualifiedApiName = 'Asset' these ...
0
votes
0answers
66 views

Salesforce API Opportunities split System.DmlException: INVALID_CROSS_REFERENCE_KEY, Unable to create an opportunity team member

I am new to salesforce.I have enabled oppotunity split with check box checked for team enabled. While i run some code or through salesforce api i am getting the following error System.DmlException: ...
0
votes
1answer
38 views

How to get this system.list exception error?

public PageReference save1(){ //Local varibles and instance //UtilityClass.isCreated =false; List<Quote_Line_item__c> qlirowIncrement=[Select id,QliRowNum__c from Quote_Line_Item__c ...