How to resolve the Database.Delete salesforce Error?
Listc = [SELECT ID FROM Contact WHERE AccountId !='00190000016ozwL']; System.debug(c.size()); Database.SaveResult[] srList = Database.delete(c, false); This is the anonymous apex that I am trying to execute.
I am getting the following error while executing.
Illegal assignment from LIST
Not sure why am I getting this error because "c" is a collection only. Can you let me know ?
Database.delete salesforce returns Database.deleteResult. Database.saveResult is returned for insert and update operations.
So you should change you code to:
Database.deleteResult[] srList = Database.delete(c, false);You can find more info here: https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_database_deleteresult.htm