fbpx

Free Salesforce Developers Tutorials >

Chapter 3 - Apex Datatypes and Operators >

ID & Blob Datatypes in APEX

ID & Blob Datatypes in APEX

What You’ll Learn


S2 Labs

What Is ID In Apex?

Any valid ID (18-character Salesforce Platform identifier). If you set ID to a 15-character value then apex converts its value to its 18-character representation.

Syntax Of ID

Id recordId = '0012w00001UNkDQAA1';
Note:

All invalid ID values are rejected with a runtime exception.

What Is Blob In Apex?

A collection of binary data stored as a single object.

A blob is typically used to store images, audio, or other multimedia objects, and sometimes binary executable code is also stored as a blob. We can convert this datatype to string or from string using the toString() and valueOf() methods.

Syntax Of Blob Data Type

String s = ‘abc’;
Blob b = Blob.valueOf(s);
String s1 = b.toString();

Salesforce certifications

Download Study Material

Get access to exclusive study material for Salesforce Certification and ace your exams!

Download Now

Our Salesforce Certification Courses

Hey there! Glad you made it through our Salesforce Developer Training for beginners . But wait! We've got some high-in-demand Salesforce courses for you to take your Salesforce skills to the next level, making you a desired professional in the Salesforce job market.

Post a Comment

Your email address will not be published. Required fields are marked *