• David Mark 11
  • NEWBIE
  • -1 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hi Friends,
I was trying a test code to insert 50,000 records using the below code, its throwing the limit exception related to dml rows of 10000 reached.

My question is since I specified  false as below
Database.SaveResult[] srList = Database.insert(lstContacts, false);
is this code suppose to insert at least 10000 records, but did'nt do it.

Let me know your comments.


My code below
List<Contact> lstContacts = new List<Contact>();
for(Integer x = 0; x<50000; x++ ){
    Contact con = new Contact(LastName= 'Keller'+x, FirstName='Helen'+x);
    lstContacts.add(con);
}
Database.SaveResult[] srList = Database.insert(lstContacts, false);

for (Database.SaveResult sr : srList) {
    if (sr.isSuccess()) {
        // Operation was successful, so get the ID of the record that was processed
        System.debug('Successfully inserted account. Account ID: ' + sr.getId());
    }
    else {
        // Operation failed, so get all errors                
        for(Database.Error err : sr.getErrors()) {
            System.debug('The following error has occurred.');                    
            System.debug(err.getStatusCode() + ': ' + err.getMessage());
            System.debug('Account fields that affected this error: ' + err.getFields());
        }
    }
}

Thanks
JG
 
I want to put this out to the sfdc developer community to see if anyone has some feedback on a question I've received as part of a technical assessment for a Salesforce developer role. 

Specifically, a hiring manager has asked me the following:
 
Given the following 2 classes:
Class Folder
name: string
parent: Folder
 
Class File
name: string
parent: Folder
 
Complete the following function in pseudocode to return the full string path of a file.
 
function getFullFilePath(file: File): string {
         …
return path
}
My question is can someone please explain to me how you would respond to this? Also, what is your interpretation of what is being asked?

 
  • January 25, 2020
  • Like
  • 0