function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rick RossiRick Rossi 

Batch Class Question

Hi!

What would a batch class look like if I want to update any email field on the account, object, and lead to "In Development". I am having issues inserting the objects in an apex class, any help would be great.

Thanks!
pico papico pa
 Create an in-memory SObject

CustomObject__c myCustomObject = new CustomObject__c (
name = 'foobar', customField__c = 'zap'
);


// Insert it into the database

insert myCustomObject;


// View its content, including ID (null until it's inserted)

system.debug( myCustomObject );


// Display a URL which you can cut and paste into your browser to see the detail page for the inserted object

String urlForDetailPage = new PageReference('/' + myCustomObject.id).getUrl();
system.debug( urlForDetailPage );
 
 
 
 (edited in firefox because Safari 3 /osx always breaks code insertions)
Hope helped! (https://2048cupcakes.io/)