Insert a record using a script from developer console using Database.Insert #inSalesforce

Insert a record using a script from developer console using Database.Insert

Database Class: Contains methods for creating and manipulating data. Some Database methods also exist as DML statements.

Candidate__c cd = new Candidate__c();
cd.Name = 'exampleCandidate';
Database.SaveResult ds = Database.insert(cd);
System.debug( 'just created a new candidate :::::: ' + ds.isSuccess() );

Database.SaveResult[] - The result record for the insert or update operation being retrieved.


Comments