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

learn more… | top users | synonyms

2
votes
1answer
26 views

How to use pageMessages and have exceptions in controller tests

So I know how to present an exception as a message to the user: public class MyController { public PageReference myMethod() { try { doSomething(); } catch (Exception e)...
0
votes
2answers
15 views

Getting null pointer exception in webservice class?

I am getting System.NullPointerException: Attempt to de-reference a null object Class.exposewsdl.getCaseDetailsFromcsNum: line 47, column 1 global class exposewsdl{ global class ...
1
vote
1answer
15 views

Field Integrity exception

While i am trying to save my work through developer console i am getting the following error. I am unable to solve this problem. But when i did the same thing through Setup->Build->Develop->Apex ...
2
votes
4answers
168 views

Untyped Catch Block?

Is it possible to have an empty catch block in Apex? I have the following code for illustration. COMPILES: public with sharing class Demo_ApexCatchBLock { public Date SendmeData(String input) ...
0
votes
2answers
28 views

Show error message from custom exception on standand page in trigger handler

I am writing a trigger in which I want to throw a custom exception to display only the exception message instead of all the details. I cannot use addError() method because its not on trigger context ...
1
vote
0answers
27 views

Field Integrity Exception for Name

I am trying to create a Related List with a custom object using the Metadata API. When I make the call I get a Field Integrity Exception saying that the field "Name" does not exist on my object. ...
4
votes
1answer
226 views

Sandbox org TLS 1.1 update breaks outbound calls

This morning, our team arrived to find our sandbox instance in disarray. Salesforce had disabled TLS 1.0 across the entire instance, breaking our homegrown applications that communicate with it via ...
1
vote
2answers
29 views

FATAL_ERROR|System.LimitException: Too many DML statements: 1

Facing an issue when we want to update our payment object in bulk. Works fine on sandbox but throws an exception error in production. Mentioning the controller below. The Error occurs at update ...
0
votes
0answers
36 views

SOAP service callout with a certificate - External server did not return any content

I have a SOAP service certificate that I added to Salesforce and created a Named Credential with it. I generated classes from WSDL, and I replaced the endpoint_x with: public String endpoint_x = '...
1
vote
2answers
23 views

Locate First Error Name in Exception Object

I see message like this Insert failed. First exception on row 0; First error: SOME_NAME_OF_ERROR I want to get this message in catch block and store it in variable, for example: String ErrorName = ??...
0
votes
0answers
13 views

Random CommunicationException while retrieving email events with SOAP API

We use the Retrieve method of the SOAP API to obtain email related events (sends, opens, clicks, notSent, bounce). This operation is being executed periodically during the day and mostly it works ...
0
votes
1answer
22 views

Extract only the error message in custom exception message

Class: (Custom Exception) public class CustomException extends Exception { } Using as below in my help class: throw new CustomErrorException('No other characters allowed'); This is working ...
1
vote
0answers
66 views

Need help || System.VisualforceException: Read access denied for null, controller action methods may not execute [closed]

Please help me resolve this VF Code <apex:outputPanel rendered="{!if((showDone && alreadydeparted), true, false)}" id="nextBtnPanel"> <!-- ACTION STATUS FOR DISABLE ENABLE NEXT ...
0
votes
0answers
37 views

Webservice Error: Apex type not found for element

I've been working with web-service call out and the other party changed the wsdl. After regenerating apex code using new wsdl, I get an error when invoking the web-service saying 'System....
1
vote
3answers
91 views

Test Class for Catch Exception getMessage

I have a class that includes the following: try { stuff.... }catch(Exception e){ ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, e.getMessage()+'ERROR')); ...
2
votes
2answers
132 views

Testing AuraHandledExceptions?

It seems like when I call getMessage on a thrown AuraHandledException, I see "Script-thrown Exception" instead of the message that I have set. Any idea why this may be happening? Controller: @...
0
votes
1answer
27 views

How can I customize the ExceptionMessage thrown by Apex Class?

I am getting the following message on my VF page. common.apex.runtime.impl.ExecutionException: Unable to Parse Date Value I wish to suppress the first part of the message which is common.apex....
0
votes
0answers
27 views

Getting Exception on Test endpoint https://webservice.test.exacttarget.com/Service.asmx on every request in Production Support environment

Getting below exception on Production Support. Same code is working fine on Production Environment. Is there any issue in hosting of webservice.test.exacttarget.com/Service.asmx service ? ...
0
votes
0answers
18 views

Gacks Error from server side

One of our customer has reported a issue where he got the below message while making an apex call. "Temporary PerEntitySchema mismatch: occasional occurrences are ok. DO NOT file a bug unless you see ...
3
votes
2answers
64 views

What's the uncommitted work on this callout test?

I'm gettin You have uncommitted work pending. Please commit or rollback before calling out.. Exception while Running a Test of the class i will attach. This class is invoked by onTask Trigger (...
0
votes
2answers
40 views

Testmethod problem: System.QueryException: List has no rows for assignment to SObject

I have the following method in which SOAP webservice is consumed created by wsdl2apex (only necessary part is shown): public class SendOrder { public void SendOrder(string OrderId) { // ...
9
votes
1answer
422 views

JSON: Cannot deserialize instance of date from VALUE_STRING

I'm officially breaking up with Salesforce Date parsing. This has got to be the most frustrating thing. I have the following date in a JSON string (full JSON below): 2017-06-03T10:34:24.000Z ...
3
votes
1answer
50 views

Catching exceptions when using Batchable with custom Iterable/Iterator

When using a custom Iterable/Iterator class with Database.Batchable, if the Iterator throws an exception it seems impossible to catch the exception. Is there any way to catch the exceptions thrown in ...
0
votes
1answer
40 views

System.NullPointerException: Argument 2 cannot be null

I am attempting to handle exceptions within the context of using a custom object that we have to display error messages. I want to capture any exception or dmlexception messages and use them in the ...
0
votes
0answers
18 views

The webservice callout from salesforce to external system to get the auth token has stopped working

When I send a request to external system its throwing an exception "System.CalloutException: Received fatal alert: protocol_version". This was working fine till yesterday and also working fine in QA ...
3
votes
2answers
212 views

Resource is inserted even thought it has a conflicting schedule with another event

I am using standard Public Calendars and Resources where I have 2 types of resources, Vector Unit and Demo Unit. Now if any of the resources have a conflicting schedule, a standard Salesforce error is ...
0
votes
0answers
174 views

Not Serializable: com/salesforce/api/fast/List$$lcom/salesforce/api/Messaging/SendEmailResult$$r

I am getting the above exception when send SingleEmail without setOrgWideEmailAddressId .What is the reason.Can anybody help Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();...
0
votes
1answer
41 views

NoAccessException on ConnectApi.ChatterFeeds.updateFeedElement : line 706 column 1

Urgent Help Needed: I am getting exception while updating a chatter feed using ConnectApi.ChatterFeeds class. I am not getting it regularly but for some specific users under a particular custom ...
2
votes
1answer
67 views

Opportunity.IsPrivate via Apex but not Developer Console?

I'm trying to query all of my Opportunity fields at runtime by using Schema.SObjectType.Opportunity.fields. This seems straightforward, but I am seeing some strange behavior when I put some of my ...
1
vote
1answer
34 views

Can you catch a thrown error down the line?

I'm trying to setup a method to make sure all the data I need is available before proceeding to the next part of my component. So I have something like this: public Boolean getIsDataLoaded(){ /* ...
6
votes
2answers
96 views

Why log status is success and not failed?

Lets say I have a VF page and a controller. I would like to know why I don't see any errors coming on the log status when there are exceptions thrown when the code runs. I am trying to deliberately ...
3
votes
1answer
29 views

sosl exception on searching with one character

On doing a sosl search with just one character search parameter, I am getting an exception. To overcome this i have used custom error message in the catch block.However I am unable to cover the catch ...
3
votes
1answer
69 views

Can Built-In Exceptions Be Thrown?

In Creating Custom Exceptions, the documentation still claims: Since you can’t throw built-in Apex exceptions but can only catch them, you can create custom exceptions to throw in your methods. ...
0
votes
1answer
52 views

Attempt to dereference null object error

I have below controller where I get Attempt to dereference a null object error at ProdIds.add(c.id); Line. Error Code public TestController(ApexPages.StandardController stdCtrl) { ...
0
votes
1answer
42 views

List out of bound exception at List<Blob>

I have below piece of code where I get below error. Here b is the List of blobs. Error List index out of bounds: 3 Apex Code for(integer i = 0; i <counter; i++) { Messaging....
2
votes
2answers
81 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
71 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 { ...
5
votes
1answer
72 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
119 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
49 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
79 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 "apex:...
0
votes
3answers
116 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
80 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 Messaging.sendEmail(...
1
vote
1answer
18 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
17 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
42 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
62 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
71 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
25 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
169 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 ...