May 2019
Intermediate to advanced
546 pages
12h 41m
English
To insert records into the database, the user needs the create permissions for that object. If we want to insert records, we use the DML statement insert, or Database.insert(Object). I'll explain the two methods to insert records into the database.
When you want to insert records, you can insert only one record or a list of records. Pay attention; it's only a list of records (not a Set or Map with records). Most of the time, you prepare the records in a variable and insert that variable (that corresponds with your record or list of records) into the database; an example is as follows:
Movie__c newMovie = new Movie__c(Name = 'Grease', Genre__c = 'Family');Insert newMovie;
With this code, you prepare a movie object with the ...
Read now
Unlock full access