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

learn more… | top users | synonyms

0
votes
1answer
16 views

How to get Dynamic Variable value In Test Class

I have Two VF pages (SME Coach, SME info). SME Coach have a Picklist field. When I choose One Value here It will Dynamically Updated in Another picklist field (SME) In SME Info. Using the Value of ...
0
votes
2answers
21 views

Exception when Importing .csv file from CLI

I am able to import my .csv file using Apex Data Loader. When I try importing the same file from CLI I am getting an exception attached in the file. When the file contents are copied into a new csv ...
1
vote
0answers
23 views

Email Service does not receive Apex Exception Mails in DE Org

In an Managed Package, we want to produce an Custom Object for each Apex Exception Mail that we receive. In order to implement that we followed the instructions we found here. We created an Email ...
2
votes
3answers
37 views

sObject type 'Partner' is not supported

I have a Update trigger on Opportunity. The trigger queries the Partner object. [Select AccountToID from Partner where OpportunityID IN: Trigger.newmap.keyset()] The above trigger has been running ...
0
votes
0answers
28 views

DMLException error not coming properly

I am trying to upsert a record and and I am expecting, when I hit the button, then it will check for Invalid Email address, and if there is any then it will show me the error in the pageMessage. ...
0
votes
2answers
52 views

How to create records with inactive user as the owner. A Salesforce Spring 15 feature

Salesforce Spring 15 release notes says 'Create or Edit Records Owned by Inactive Users'. But I am unable to assign any inactive user as the owner of the record in Spring 15 Org. I get the ...
0
votes
2answers
42 views

Null Pointer exception

I have below generic class, whose methods are called from an Account before insert , before update trigger. Below class is getting a Null Pointer exception for any Account at commented line. Can ...
0
votes
1answer
39 views

What type of Exception is thrown for using inactive Users?

I've got a Before Update trigger that attempts to assign a new Owner on Accounts and I'm trying to handle the potential exception where the new Owner is inactive. I can cause the error in testing (An ...
0
votes
1answer
24 views

When exactly would a Calloutexception occurs in Salesforce?

I am trying to send a XML from Salesforce to an external system and callout exception occurs time and again . It is occurring sometime but working fine most of the times . What are the cases when a ...
0
votes
1answer
31 views

List out of bound in below code

I am getting list out of bound error here in below code. Can someone please help me? Apex class snippet: for(Incident_abv__c inc : [select Name,Id from Incident_abv__c where ...
1
vote
2answers
76 views

INVALID_CROSS_REFERENCE_KEY Exception

I keep getting this error when running a Test Class and I just don't know where to go from here. I've tried disabling Parrallel Apex Testing, running the code as a standard user, etc. I must be ...
4
votes
2answers
79 views

Does one use savepoints in triggers?

It's not clear to me. Suppose I write an after update trigger on opportunity to update some related accounts and then contacts. Now I lets suppose that I had luck with the accounts but the second ...
1
vote
1answer
150 views

Ending position out of bound exception

I have below trigger that is getting below. I want just the letter after '-' to be in uppercase. Compile Error: execution of BeforeUpdate caused by: System.StringException: Ending position out ...
1
vote
1answer
34 views

Detecting and retrying CalloutException in Batchable iterable

I have a nightly batchable job in my SFDC org that queries a remote SFDC org for account and opportunities meeting certain criteria. Works great but every so often, I get System.calloutException read ...
1
vote
1answer
27 views

Catching exception and posting it back on the page

I am trying to catch an exception and have it send an email as well as post message back on the case record, when user hit save, so the user will see it as well. what I am get is this ...
2
votes
0answers
70 views

System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out in test class

I am facing this issue in a MockCallOut for http in test class. I know that a dml is not allowed just above the callout, so I have tried to put callout between Test.startTest() and Test.StopTest(); I ...
3
votes
1answer
46 views

Handle exception in managed package

What are the different approaches to handle exceptions inside a managed package? Just a brief heads up would be really helpful. From my research, I understand that it is not possible to get the ...
0
votes
1answer
66 views

SOAP callout error: Failed to deserialize value

I am testing an integration between Salesforce and another system via Web Service Collouts. For that, I am using WSDL->APEX generated class. When invoke the web service via anonymous apex, I get a ...
0
votes
2answers
52 views

List Index Out of bound exception

Please find my below code that is getting list index out of bound exception. Apex Class: global class Incidentimp_2 implements Database.Batchable < sObject > { public string query = ...
19
votes
9answers
405 views

How can I cause side effects outside a transaction context?

I've got a scenario that relies on the system's "automatic rollback" behaviour to undo any DML, emails, futures and so on, in the case of an error. Basically, by allowing code to throw an unhandled ...
-1
votes
2answers
57 views

How to resolve the apex Governor limit exceptions?

i am newly move into salesforce. am facing some exception problems. For example: In my Controller, lot of insertion and updation of data. whatever the Trigger i have inside my all, they are getting ...
0
votes
1answer
71 views

How can I communicate a trigger exception to user in a bulk upsert for each record?

I am performing a bulk upsert with a large batch (sometimes as much as 3000 records at one time). I am splitting the list of 3000 into 5 batches and performing an upsert using the Bulk API. When I ...
0
votes
1answer
93 views

Getting "System.DmlException: Process failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY

below is method which i have created in my class, public static void rejectCRF(String recordId, String workItemId, String comments) { Approval.ProcessWorkitemRequest req2 = new ...
0
votes
0answers
62 views

Design Approach: Apex Callout limits

I am developing an appexchange managed application intended for multiple subscribing organizations and as a part of requirement my managed application needs to make an extensive API callout to an ...
1
vote
3answers
949 views

System.LimitException: Apex CPU time limit exceeded

I got this exception while running following script in developer console.I need to update account records by using this script. YearExt yr = new YearExt(); List<Id> accountIds = new ...
0
votes
1answer
54 views

How to manually give a callout in test class

I needed to throw a callout exception by hardcoding it in test class for batch class.Is there any method to do that ? try{ XXXX } catch (CalloutException excpObj) { ...
2
votes
1answer
99 views

Why record is removed on exception thrown

I'm inserting and updating a new record before throw an exception like this: Operation__c o = new Operation__c(ok__c = false,Step__c = 'test1'); insert o; system.debug(o); //this shows the Id try{ ...
1
vote
1answer
207 views

Database.executeBatch cannot be called from a batch start, batch execute, or future method

I have an after insert,after update trigger on object A which calls Database.executeBatch for insert and update operation which inserts and updates object A records.I have anotherafter insert trigger ...
3
votes
1answer
58 views

Is there a way to catch the “Search Unavailable” exception that is thrown when doing a SOSL query?

We have a try/catch block around the line doing the query, but we still get this exception mailed to us on some SOSL queries: List<List<SObject>> ret, queryResult; try { ...
1
vote
1answer
103 views

Validation fails, but no exception generated

I have a VF page for input of a custom object. As part of the object, I have validation rules. My problem is that a failing validation fails to generate an exception. It also fails to create the row ...
4
votes
2answers
225 views

Governor limit SOQL 101 being suppressed. How?

As far as I know, Governor limits can not be suppressed and will be shown to user on the UI. However I am facing below scenario where SOQL 101 limit is being logged into debug log and not being shown ...
1
vote
1answer
1k views

System.NullPointerException: Argument cannot be null

Im getting the error 'System.NullPointerException: Argument cannot be null' when I run my test class, in the below test method. /* * update a existing report */ static testMethod void ...
7
votes
0answers
110 views

Creating Idea Votes from portal user in Test code. DML Exception

I Wrote a very simple VF Page and Controller to show the Accounts that voted on certain Ideas. Here is the controller. Just aggregates the Up and Down votes on the Idea excluding internal votes. ...
3
votes
1answer
420 views

System.DmlException: Delete failed.SELF_REFERENCE_FROM_TRIGGER

Hi All I have written the apex trigger.It working in sandbox but not in Production.While upload the csv file by using apex data loader in production it throws an exception below. Exception: ...
2
votes
1answer
63 views

Check APEX exception type

I'm looking to check what type of exception is retruned in the following code snippet. I'm not sure exactly how to do it though, or if it's even possible. try { //SOME LOGIC } catch (exception ...
3
votes
1answer
232 views

Unable to Delete the records/rows in Trigger

I have trigger it working in Sandbox.It delete the records when the field "Delete__c" check box is checked.I have tested 200 rows,Trigger deleted rows in sandbox but the same scenario in production ...
2
votes
1answer
134 views

renderAs CSV (10K+ rows): What are the best practices available to avoid hitting Apex cpu time limit exceeded limits?

I am trying to download a CSV using render as attribute in apex:page. The output data that is rendered is the real-time response from a callout from salesforce to SAP webservice. The number of records ...
5
votes
1answer
229 views

How to capture those records that was unable to get inserted?

Say, I have a list of 1000 records to be inserted. How to capture those records that failed to get inserted? I realize that I can use DMLException to get the error. But how to get a list of failed ...
0
votes
0answers
64 views

Unknown Exception. Too many Query rows

I have 3 SOQL Queries running in an Apex class. I'm using the related VF page in Force.com sites. When this code runs, it is throwing an exception on the page. No exception is caught in debug logs. ...
0
votes
2answers
70 views

How to handle the exceptions occured in expressions used in visualforce page?

I am having an expression to divide a number and get the percentage and display it in vf page. The following expression in visualforce page working fine previously is now complaining and ended with an ...
1
vote
2answers
155 views

Apex DML bulk insert - how to display only list elements that fail DML

I have a try catch block to handle any problems when inserting a list of users, however, if an exception is encountered, how can I output which user in the list this exception is occurring for? I'm ...
6
votes
1answer
88 views

System.UnexpectedException: Read of id returned an invalid id '000000000000000'

Since a few days ago a some methods in one test class started to fail with this exception System.UnexpectedException: Read of id returned an invalid id '000000000000000' What is more ...
1
vote
1answer
175 views

System.AsyncException: No enclosing class for method: methodName

I have this error that says "System.AsyncException: No enclosing class for method: methodName". The code structure : trigger trgSendRecords on DataSetup__c (after insert) { /* SOME BUSINESS ...
2
votes
0answers
179 views

System.CalloutException: Received fatal alert: bad_record_mac in calling External URL

I am having the below error for calling out the external web URL which is supposed to be accessed by public at all time. System.CalloutException: Received fatal alert: bad_record_mac I found that ...
2
votes
1answer
329 views

Third party API has callout time limits: how to catch with error handling, and how to control callout timing?

The third party API I'm working with (Act-On, a marketing software), has a limit of 5 callouts per minute in their sandbox. Unfortunately for me, some of my code requires that I loop through a series ...
2
votes
1answer
146 views

How can I dynamically transverse dynamically SOQL'd SObject fields in Apex?

So, in my other post, I figured out for myself how to dynamically transverse SObject fields in Apex. But within the context of my work, there is a problem with the solution as it currently stands: ...
4
votes
3answers
503 views

Trigger : Need Help for showing a nicer error

I have created a trigger for the following behavior in my Salesforce org: When the user changes the Account Owner, it automatically changes the Contract Owner on the related contracts before update. ...
1
vote
2answers
169 views

Custom Exceptions — How does SFDC get it done in the back end?

Suppose I have the following Class: public class Yup{ public class YupException extends Exception{}//END YupException public static void debugTestException(){ YupException ...
3
votes
2answers
2k views

System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out

Im getting CalloutException.You have uncommitted work pending. Here's my VF Page. <apex:commandbutton> SAVE </apex:commandbutton> <apex:pageBLock> <apex:column> ...
2
votes
3answers
594 views

System.TypeException: Invalid date:05/05/2013

i just executed these lines in anonymous block and got this exception. Any suggestions? Date dt; dt = Date.valueOf('05/05/2013'); System.debug(dt); System.TypeException: Invalid date: 05/05/2013 ...