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
Raju Banothu 6Raju Banothu 6 

how to delete null records using apex or trigger

I have Adhar__C field in Member__C object, in existing records which adhar field is null i want to delete those records. Can anyone explain how to achieve this?
Jessica smartJessica smart
Set<String> uniqueStrings = new Set<String>(); // Keep checking for null and then add to Set for (Integer i = 0; i < 100; i++) { if(somevalue !== null){ uniqueStrings. add(i); } } // Add everything to Set and then remove null at the end for (Integer i = 0; i < 100; i++) { uniqueStrings    

https://www.gtaportal.org/
 
AnkaiahAnkaiah (Salesforce Developers) 
Hi Raju,

Try with below code using Annonums window.
List<Member__c> memberlist = [Select id from Member__c where Adhar__C=Null];

Delete memberlist;

If this helps, Please mark it as best answer.

Thanks!!
hejal necktahejal neckta
Anime ist in Deutschland eine der am meisten konsumierten Arten von Fernsehunterhaltung und hat eine sieht (https://aniworldto.de/) große Fangemeinde.