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

learn more… | top users | synonyms

0
votes
0answers
14 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
58 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
37 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
188 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
34 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
24 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
10 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
202 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
43 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 ...
0
votes
1answer
27 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
57 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
30 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(){ /* ...
4
votes
2answers
76 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
26 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
42 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
49 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
37 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++) { ...
2
votes
2answers
62 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
31 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
48 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
101 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
46 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
73 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
60 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
70 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 ...
1
vote
1answer
16 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
34 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
40 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
43 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
23 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
151 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
54 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
58 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
38 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
64 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
49 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
45 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
82 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
37 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
35 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
103 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
81 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
34 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 ...
1
vote
1answer
562 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
11 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
36 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
45 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
49 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
96 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 ...