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
PRADEEP YADAV 5PRADEEP YADAV 5 

Discreate Record Soql Query

discreate Account Record 
Akshay SethiaAkshay Sethia
Either use Apex trigger to fetch the record and delete it.
like:
trigger <triggername> on <objectname> (after insert) {
    List<<objectname>> obj = [ SELECT Columns you need FROM <objectname> WHERE any condition you have comes here ];
    delete obj;
}
Or use the below SOQL query in Anonymous Window and execute the code inside below over ther and the same result will be obtained.
List<<objectname>> obj = [ SELECT Columns you need FROM <objectname> WHERE any condition you have comes here ];
    delete obj;

or you can go the the sales app and go to the Account object page and delete the record from there.

Note: Use trigger only when you want to this to be done everytime you create a record.


 
PRADEEP YADAV 5PRADEEP YADAV 5
Hi Akshay 
But This Type of Problem will be doing through soql not a trigger.
Ex- Discrete Student In the Class
Akshay SethiaAkshay Sethia
Then you can use delete Record from lwc.