Slaesforce FAQ

how to handel invalid id salesforce apex

by Dr. Adriana Boehm Published 2 years ago Updated 2 years ago
image

What does it mean when you get an error in Salesforce?

If you are receiving the Salesforce Error "ID Value of Incorrect Type" this means that an ID being sent to Salesforce is not the correct type that Salesforce is expecting.

What to do if your error message is only showing one ID?

If your error message is only showing one ID (For example, "2.1. Create Attachment - Parent ID : id value of incorrect type: 00P41000005zgucEAA") the best first step is to look at your Salesforce Objects Reference.

Using Anonymous Apex in the Developer Console and UserInfo.getSessionId ()

In the Developer Console, press Ctrl/Cmd-e to launch the Anonymous Apex window. One would think the following would work well:

Retrieving a cookie with Javascript in a bookmarklet

This is the one that I use and love. Convenient, and more secure than the above solutions.

image
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 2 3 4 5 6 7 8 9