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

learn more… | top users | synonyms

1
vote
0answers
15 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
26 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
33 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
19 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
26 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 ...
2
votes
1answer
25 views

Rollback complete batch process

I want to roll back a complete batch related transaction if there is any exception while processing anywhere during batch execution I can roll back that specific transaction, but not sure if I can ...
0
votes
0answers
14 views

API timeout issue, connecting to Parse database

We have an API integration built out between Salesforce and Parse. We've limited our record size to a couple thousand for testing purposes and now that we've completed our mappings, are wanting to ...
0
votes
2answers
23 views

Before Insert or Upsert list must not have two identically equal elements

I am trying to create a function which reads selected rows of contact and saves them only if they don't already exist. but i get error for "Before Insert or Upsert list must not have two identically ...
0
votes
1answer
23 views

NullPointer Exception at Boolean value assign

Please find below class where I get Null Pointer Exception while assigning value to boolean. Please let me know where is my fault here? Thanks! Apex Class: public class CallReplica_controller { ...
3
votes
3answers
58 views

Can I get the type of the sObject that threw DmlException from catch block?

I've got a function that does DML on a couple of different objects, one after the other. Looks something like this: Savepoint sp = Database.setSavepoint(); try { Account[] accts = someList; ...
2
votes
1answer
74 views

Tooling API error: Object type not accessible (JSforce)

I have this very simple script on the JSforce script executor: var apexBody = "<apex:page standardController='Account'>Test</apex:page>"; conn.tooling.sobject('ApexPage').create({ ...
1
vote
1answer
21 views

List more than one row error

I have below controller where SaveOutcome method throws error : "System.QueryException: List has more than 1 row for assignment to SObject" Can someone please let me know the root cause. ...
4
votes
2answers
26 views

Failing test is showing as passed

In Debug Logs I can see a System.NullPointerException for the unit test that was just run, but on the Apex Test Execution page I see the test as passing. The error is not buried within the log ...
2
votes
1answer
112 views

Custom Exception Handling & Logging

I've set out to build a custom error handling and logging feature for my org wherein all apex exceptions will be logged into a custom sObject for analysis and follow-up. public class TriggerException ...
0
votes
1answer
33 views

Calling JSON.deserialize() throws “System.NullPointerException: Attempt to de-reference a null object”

I'm trying to use the System method JSON.deserialize(jsonString, apexType) to deserialize the body of an ApexRest POST request. My code compiles, but at runtime I'm getting a ...
0
votes
0answers
44 views

Upsert throws Missing Argument exception. Any thoughts please?

I tried to upsert and my code is below. But i am getting an exception and nothing is inserted or updated. Any thoughts please. if(lstp.size()>0) { Boolean isUpsertfirstTime = true; try { ...
2
votes
2answers
91 views

SObject Exception: Invalid field for Opportunity

I am attempting to set a flag on the Opportunity Header based on an Aggregate Query of the Opportunity Line Item object, and I keep getting an SObject Exception. My code and the error log are below, ...
0
votes
1answer
54 views

JSON single quote exception while testing REST service using Postman client. Any suggestions?

While testing a REST service i am getting a JSON parsing exception as given below. [ { "errorCode": "APEX_ERROR", "message": "System.JSONException: Unrecognized character escape ...
2
votes
0answers
44 views

SOAP API extend idle time

I am running the following query SELECT Id, ParentId, Name, ContentType, BodyLength, Body, OwnerId, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp FROM Attachment ...
2
votes
4answers
263 views

How to insert a record and then do callout? [duplicate]

I have a visualforce page where i get a serial number and making callout to get the related information from external system on click of a button. Before making the callout i need to insert a record ...
2
votes
1answer
92 views

How to catch custom exception in a test that causes a DML exception

I am writing a test for a 'before insert' trigger. In the trigger, an exception is thrown if there is a problem with the validation (by design). In production, the trigger catches the exception and ...
1
vote
1answer
93 views

Developer script exception -System.SObjectException: Invalid field MyField__C for OBJECTNAME

I have written following code in one of my Trigger - List<Setting__c> settings = new List<Setting__c>(); settings = [select name,field_api__c,Type__c from Setting__c where Object_Label__c ...
3
votes
1answer
32 views

Testing, getting a null reference in a list when it is not null?

Ok, I am confused as to why I am not getting a list returned back to me. The error I am getting is: System.ListException: List index out of bounds: 0 However, I know that means that there is ...
1
vote
1answer
17 views

reassigning account executives - apex class

I am trying to reassign Account executives depending on the requested date of open cancellation opportunities. If the requested date is 90 days later than today, I want the open cancellation ...
2
votes
1answer
53 views

System.unexpected exception when I run Reports.ReportManager.runReport(Id,true) within for loop

I am facing System.unexpected exception when I excecute below code. List<Report> repList=[SELECT Id, name,DeveloperName, Format FROM Report WHERE ...
4
votes
1answer
97 views

Can you make trigger exceptions pretty in standard page layouts?

We have a situation where it is possible for a trigger to throw an exception that will be shown to the end user. This isn't ideal as the user sees a lengthy message containing what is essentially a ...
0
votes
2answers
118 views

I get System.LimitException: Too many query rows: 50001 when querying via a static method in a different class but not if querying from the same class

I understand this exception. But what I don't understand is this: THIS APPROACH WORKS: public List<String> optionType { get { if (optionType == null) { ...
1
vote
2answers
36 views

How to access this transaction's debug log from a trigger?

"Developer script exception" emails that are sent to developers for unhandled exceptions sometimes include full debug log. How can I access this debug log from a trigger so that I can email it to ...
3
votes
0answers
112 views

ValidationRule queried via REST API returns Deleted objects VR too and that results in error with GACK?

UPDATE [15 Jul'15] : Salesforce support confirmed that this is indeed a bug and their Research & Development team is working on this case and the matter is under our observation. Here is ...
1
vote
3answers
112 views

Invalid Foreign Key Relationship when referring to custom object text field

Hopefully this is a simple one, but I'm pretty stumped. Basically, I'm editing a text field of a custom object. However, it seems I get a Invalid Foreign Key Relationship error when I try and check ...
2
votes
1answer
159 views

Retreiving the value causing a DUPLICATE_VALUE DML Exception

I have an inventory management system I am working on and I have the need to let users input values to be created into inventory. These values consist of numbers that are used as the name for the ...
1
vote
1answer
99 views

System.LimitException occurs in WSDL Class

I'm getting System.LimitException: Too many callouts: 101 error message in my WSDL class file generated by SFDC. Repeated error was shown as following: ...
2
votes
1answer
1k views

Webservice Callout Exception: IO Exception: Read timed out

I have Salesforce trigger that triggers either a future method or batch job that does call outs to a SOAP webservice. I am randomly getting "(IO Exception: Read timed out)" exception. When the ...
0
votes
1answer
71 views

Database DML throwing exceptions

According to SF if we use the Database class to issue a DML command: instead of exceptions, a result object array (or one result object if only one sObject was passed in) is returned containing ...
1
vote
1answer
101 views

Field Validation Exception and Database Class vs DML Statements

I'm trying to write a trigger and having some real trouble in making it work. Background: we adopted the Country/State picklist "Feature" last year. All the cleanup wasn't done. We have some records ...
1
vote
2answers
42 views

Which custom save() is better?

Sometimes in code examples of custom save methods (of controller extensions) you see the use of try/catch and an explicit translation of Exception to PageMessage. Explicit Error Handling: public ...
1
vote
2answers
244 views

System.ListException: Before Insert or Upsert list must not have two identically equal elements

I am trying to upsert some CustomObject__c record based on some criteria related to Opportunity Records. Set<Property2__c> properties = new Set<Property2__c>(); List<Property2__c> ...
0
votes
2answers
206 views

Ending position out of bounds

I have below trigger which passes string values to below class to do some changes for update. Please find the trigger. Trigger: trigger AccountFieldAutoUpdates on Account (before insert, before ...
3
votes
2answers
436 views

How to remedy “System.QueryException: expecting a colon” within Batch query

I have a Batchable class for scheduling a lead reassignment process. I recently made some edits to the query string and nod I am getting the error System.QueryException: expecting a colon, found ...
1
vote
1answer
87 views

Finish method in batch job not invoked after an exception is thrown and caught

I'm using Database.update in my batch class. This is wrapped around by a try/catch block. When I run the batch job some error occurs which is caught as I'm throwing a custom exception and catching it. ...
1
vote
0answers
17 views

QueryException for visible managed package field?

I've got a basic query that references fields in a managed package. The field is visible to all profiles, and the object has view all perms for all profiles. But throws this query exception No ...
4
votes
0answers
54 views

Exception during Inserting attachment from managed package

I'm working on managed package and I have to insert Attachment record from my apex code. The code is pretty simple, that's just create and insert Attachment, something like that: Attachment ...
0
votes
1answer
246 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
46 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
1answer
90 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
488 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
63 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. ...
1
vote
4answers
520 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
165 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
112 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 ...